SQL SERVER – @@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT – Retrieve Last Inserted Identity of Re

SQL SERVER – @@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT – Retrieve Last Inserted Identity of Re

瀏覽:1011
日期:2025-06-13
I need to retrieve identity column value from the below query: INSERT INTO table-name(col1, col2) VALUES(val1, val2); SELECT SCOPE_IDENTITY() using C + MS-SQL through ODBC Please find the psuedo code that I have used: hstmt = SQLAllocHandle odbc ......看更多