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