[MSSQL]取得剛新增資料的自動編號 - 孤影棧- 點部落
select scope_identity() 之前我都是使用 select @@identity 來取的自動編號的資料. 而這兩者之間的差異在於 ... with the @@IDENTITY and SCOPE_IDENTITY functions*/ INSERT TZ VALUES ('Rosalie') SELECT SCOPE_IDENTITY() AS [SCOPE_IDENTITY] GO ...
www.dotblogs.com.tw |