diff options
author | Andrey Andreev <narf@devilix.net> | 2015-10-13 13:38:30 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-10-13 13:38:30 +0200 |
commit | 9d02ceafe0aa5ec755f1d8b011cf21f3841191cc (patch) | |
tree | c19e38106d6e5979da1061d5a4ac5d83ba88a871 /system/database/drivers | |
parent | a3643a5e92cfe09b48327141d2b52701ab172977 (diff) |
[ci skip] Fix #4170
Diffstat (limited to 'system/database/drivers')
-rw-r--r-- | system/database/drivers/sqlsrv/sqlsrv_driver.php | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index 8d383b274..1df3a4258 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -275,9 +275,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ public function insert_id() { - $query = $this->query('SELECT @@IDENTITY AS insert_id'); - $query = $query->row(); - return $query->insert_id; + return $this->query('SELECT SCOPE_IDENTITY() AS insert_id')->row()->insert_id; } // -------------------------------------------------------------------- |