@@indentity changed to something a bit more stable

This commit is contained in:
Geoff Munn 2009-03-30 03:06:25 +00:00
parent bb4acb78c8
commit 1d06cfc10e

View File

@ -180,7 +180,8 @@ class MSSQLDatabase extends Database {
} }
public function getGeneratedID($table) { public function getGeneratedID($table) {
return $this->query("SELECT @@IDENTITY FROM \"$table\"")->value(); //return $this->query("SELECT @@IDENTITY FROM \"$table\"")->value();
return $this->query("SELECT IDENT_CURRENT('$table')")->value();
} }
function getPrimaryKey($tableName){ function getPrimaryKey($tableName){
@ -1012,6 +1013,7 @@ class MSSQLDatabase extends Database {
return $searchResults; return $searchResults;
} }
} }
/** /**