Module Sequel::ADO::MSSQL::DatabaseMethods
In: lib/sequel/adapters/ado/mssql.rb

Methods

Included Modules

Sequel::MSSQL::DatabaseMethods

Constants

ROWS_AFFECTED = "SELECT @@ROWCOUNT AS AffectedRows"   Query to use to get the number of rows affected by an update or delete query.

Public Instance methods

Issue a separate query to get the rows modified. ADO appears to use pass by reference with an integer variable, which is obviously not supported directly in ruby, and I‘m not aware of a workaround.

[Source]

    # File lib/sequel/adapters/ado/mssql.rb, line 18
18:         def execute_dui(sql, opts=OPTS)
19:           return super unless @opts[:provider]
20:           synchronize(opts[:server]) do |conn|
21:             begin
22:               log_yield(sql){conn.Execute(sql)}
23:               res = log_yield(ROWS_AFFECTED){conn.Execute(ROWS_AFFECTED)}
24:               res.getRows.transpose.each{|r| return r.shift}
25:             rescue ::WIN32OLERuntimeError => e
26:               raise_error(e)
27:             end
28:           end
29:         end

[Validate]