Sha256: 39ee2ccacd9b3a441f6225c935d1ef0c27c2452725e776c39848800b1efeb472
Contents?: true
Size: 584 Bytes
Versions: 3
Compression:
Stored size: 584 Bytes
Contents
module ActiveRecord module ConnectionAdapters class SQLServerAdapter def sql_for_insert(sql, pk, id_value, sequence_name, binds) sql = if pk # support composite primary keys consisting of more than one column name inserted_pks = [pk].flatten.map {|pk| "inserted.#{pk}"} sql.insert(sql.index(/ (DEFAULT )?VALUES/), " OUTPUT #{inserted_pks.join(", ")}") else "#{sql}; SELECT CAST(SCOPE_IDENTITY() AS bigint) AS Ident" end [sql, binds] end end end end
Version data entries
3 entries across 3 versions & 1 rubygems