Possible Duplicate:
SQL: How to get the id of values I just INSERTed?
For PHP, What's equivalent of mysql_insert_id()
for sql server 2012?
sqlsrv_insert_id()
does not seem to exist.
Say this is the code
if ($result) {
// get user details
$uid = mysql_insert_id(); // last inserted id
$result = mysql_query("SELECT * FROM users WHERE uid = $uid");
// return user details
return mysql_fetch_array($result);
} else {
return false;
}
for mysql, how should I do it for sql server?