开发者

how i can get inserted id for sql server with php [duplicate]

This question already has answers here: 开发者_高级运维 Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜