how i can get inserted id for sql server with php [duplicate]
Possible Duplicate:
How to get Insert id in MSSQL in PHP?
im working in project by php and sql server 2000, how i can get inserted id like mysql_inserted_id function which work with mysql . im googled in the internet and cant find something...please leave example to how use it
You probably want to use SCOPE_IDENTITY() (which you can return via a SELECT statement) but the operator you use to get the latest ID depends on your implementation (your stored procedure may do more than one insert, for example, in which case @@IDENTITY would return only the latest ID). Check out this explanation:
http://www.sqlteam.com/article/alternatives-to-identity-in-sql-server-2000
精彩评论