rails-sqlserver / activerecord-sqlserver-adapter

SQL Server Adapter For Rails
MIT License
968 stars 558 forks source link

Fix creation of stored procedures that contain insert statements #1088

Closed aidanharan closed 9 months ago

aidanharan commented 9 months ago

When creating a stored procedure that contained an insert statements, the SQL was being incorrectly flagged as a insert statement. We should check the start of the string to find if an SQL statement is an insert, rather than each line of the string. Issue introduced in Rails 7.0 branch by https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/988

Fixes https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/1087