These are chat archives for rails-sqlserver/activerecord-sqlserver-adapter
x-x-stablebracnh contains docs in the readme of the min version.
I am trying to load a view using ActiveRecord::Base.connection.execute, and I am seeing an interesting message.
string = "DROP VIEW IF EXISTS dbo.bros; GO CREATE VIEW dbo.bros AS SELECT 'true' = 'true';" ActiveRecord::Base.connection.execute string
Pretty much it boils down to the above code throwing the following error:
ActiveRecord::StatementInvalid: TinyTds::Error: 'CREATE VIEW' must be the first statement in a query batch.: DROP VIEW IF EXISTS dbo.bros;
Are we not able to use the keyword GO inside of an ActiveRecord::Base.connection.execute?
schema:loadto execute that schema plus file.
This might be getting off topic a bit, but right now for my old rails with postgresql I have a directory for custom sql that the schema file couldn't account for, and I patched schema:load to load all the files in that directory with ActiveRecord::Base.connection.execute File.read(file_name)
So I was hoping to do the same for SQL Server.