Reputation: 60691
is there a difference in the way this functions between the two databases mysql and sql server:
SELECT @@identity
Upvotes: 2
Views: 1936
Reputation: 1220
Yes: Since that doesn't appear to be in the ANSI SQL standard, it is left to the DBMS vendor to roll their own methods.
mysql_insert_id()
Upvotes: 1
Reputation: 135789
I prefer SCOPE_IDENTITY() in SQL Server to avoid issues with triggers.
Upvotes: 4