views:

77

answers:

2

is there a difference in the way this functions between the two databases mysql and sql server:

SELECT @@identity
+3  A: 

I prefer SCOPE_IDENTITY() in SQL Server to avoid issues with triggers.

Joe Stefanelli
+1  A: 

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() 
Rawheiser