-1
可能重複:
How to get Insert id in MSSQL in PHP?我怎樣才能插入ID爲SQL Server使用PHP
IM通過PHP和SQL Server 2000在項目中工作,我怎麼能得到插入ID喜歡與mysql一起工作的mysql_inserted_id函數。 即時通訊在互聯網搜索和找不到東西...請留下示例如何使用它
可能重複:
How to get Insert id in MSSQL in PHP?我怎樣才能插入ID爲SQL Server使用PHP
IM通過PHP和SQL Server 2000在項目中工作,我怎麼能得到插入ID喜歡與mysql一起工作的mysql_inserted_id函數。 即時通訊在互聯網搜索和找不到東西...請留下示例如何使用它
你可能想要使用SCOPE_IDENTITY()(你可以通過SELECT語句返回),但你用來獲得最新的ID取決於你的實現(你的存儲過程可以做多個插入,例如@@ IDENTITY只會返回最新的ID)。看看這樣的解釋:
http://www.sqlteam.com/article/alternatives-to-identity-in-sql-server-2000
從網上
除此之外,也總是搜索堆棧溢出!請參閱[如何在MSSQL中獲取插入ID在PHP?](http://stackoverflow.com/questions/574851/how-to-get-insert-id-in-mssql-in-php) – 2011-04-09 18:39:45
這是什麼不同比[最後一次你問這個問題](http://stackoverflow.com/questions/5564875/how-i-can-get-the-id-generated-in-the-last-query-by-php-with - SQL服務器)? – Charles 2011-04-09 19:15:08