views:

599

answers:

2

How do you get the identity column value after an insert in SQL Server Compact 3.5?

+1  A: 

I guess you have to use @@IDENTITY. I figured compact would have SCOPE_IDENTITY(), but I guess not. Just try scope_identity to be sure. :)

JP Alioto
I didn't think SSCE supports sql batch statements, will have to check
Kumar
+1  A: 

I think what you want is @@IDENTITY:

SELECT @@IDENTITY AS Identity

This will return the value of the last identity inserted.

Matthew Jones
I didn't think SSCE supports sql batch statements, will have to check
Kumar