Class | Sequel::ADO::MSSQL::Dataset |
In: |
lib/sequel/adapters/ado/mssql.rb
|
Parent: | ADO::Dataset |
Use a nasty hack of multiple SQL statements in the same call and having the last one return the most recently inserted id. This is necessary as ADO doesn‘t provide a consistent native connection.
# File lib/sequel/adapters/ado/mssql.rb, line 23 23: def insert(values={}) 24: return super if @opts[:sql] 25: with_sql("SET NOCOUNT ON; #{insert_sql(values)}; SELECT CAST(SCOPE_IDENTITY() AS INTEGER)").single_value 26: end