Class | Sequel::ADO::MSSQL::Dataset
In: | lib/sequel/adapters/ado/mssql.rb
Parent: | ADO::Dataset

### Methods

insert provides_accurate_rows_matched?

### Included Modules

Sequel::MSSQL::DatasetMethods

### Public Instance methods

insert(*values)

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.

[Source]

        # File lib/sequel/adapters/ado/mssql.rb, line 61
    61:         def insert(*values)
    62:           return super if @opts[:sql]
    63:           with_sql("SET NOCOUNT ON; #{insert_sql(*values)}; SELECT CAST(SCOPE_IDENTITY() AS INTEGER)").single_value
    64:         end

provides_accurate_rows_matched?()

If you use a better :provider option for the database, you can get an accurate number of rows matched.

[Source]

        # File lib/sequel/adapters/ado/mssql.rb, line 68
    68:         def provides_accurate_rows_matched?
    69:           !!db.opts[:provider]
    70:         end

[Validate]