diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-14 22:24:55 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-14 22:24:55 +0000 |
commit | fb1efcaf91511285a0a656621a823a97a75975b3 (patch) | |
tree | 4b2885f60cacc7071024cfa173cee136b4cb71b8 /activerecord/lib/active_record | |
parent | 415d27490f14f7ba360a0edd3d9e1211f7482c89 (diff) | |
download | rails-fb1efcaf91511285a0a656621a823a97a75975b3.tar.gz rails-fb1efcaf91511285a0a656621a823a97a75975b3.tar.bz2 rails-fb1efcaf91511285a0a656621a823a97a75975b3.zip |
SQLServer: insert uses given primary key value if not nil rather than SELECT @@IDENTITY. References #2866.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3035 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb index fecc6a7e1c..ec85c88c61 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb @@ -236,7 +236,7 @@ module ActiveRecord end log(sql, name) do @connection.execute(sql) - select_one("SELECT @@IDENTITY AS Ident")["Ident"] + id_value || select_one("SELECT @@IDENTITY AS Ident")["Ident"] end ensure if ii_enabled |