class Sequel::ADO::MSSQL::Dataset
Public Instance Methods
insert(*values)
click to toggle source
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's default :provider uses a separate native connection for each query.
Calls superclass method
Sequel::Dataset#insert
# File lib/sequel/adapters/ado/mssql.rb, line 57 def insert(*values) return super if @opts[:sql] || @opts[:returning] with_sql("SET NOCOUNT ON; #{insert_sql(*values)}; SELECT CAST(SCOPE_IDENTITY() AS INTEGER)").single_value end
provides_accurate_rows_matched?()
click to toggle source
If you use a better :provider option for the database, you can get an accurate number of rows matched.
# File lib/sequel/adapters/ado/mssql.rb, line 64 def provides_accurate_rows_matched? !!db.opts[:provider] end