Query to use to get the number of rows affected by an update or delete query.
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.
# File lib/sequel/adapters/ado/mssql.rb, line 20 def execute_dui(sql, opts=OPTS) return super unless @opts[:provider] synchronize(opts[:server]) do |conn| begin log_connection_yield(sql, conn){conn.Execute(sql)} rows_affected_sql = "SELECT @@ROWCOUNT AS AffectedRows" res = log_connection_yield(rows_affected_sql, conn){conn.Execute(rows_affected_sql)} res.getRows.transpose.each{|r| return r.shift} rescue ::WIN32OLERuntimeError => e raise_error(e) end end end