I have inserted a row in a table. How do I "SELECT" the primary key of the row just inserted?
For MS SQL Server:
SCOPE_IDENTITY() will return you the last generated identity value within your current scope:
SCOPE_IDENTITY()
SELECT SCOPE_IDENTITY() AS NewID