summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-10-13 13:38:30 +0200
committerAndrey Andreev <narf@devilix.net>2015-10-13 13:38:30 +0200
commit9d02ceafe0aa5ec755f1d8b011cf21f3841191cc (patch)
treec19e38106d6e5979da1061d5a4ac5d83ba88a871 /system
parenta3643a5e92cfe09b48327141d2b52701ab172977 (diff)
[ci skip] Fix #4170
Diffstat (limited to 'system')
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_driver.php4
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;
}
// --------------------------------------------------------------------