SQLTeam.com Logo

Return to Retrieving the GUID value of an inserted row

Retrieving the GUID value of an inserted row

Written by Bill Graziano on 03 June 2002

Narayana Vyas Kondreddi submitted "This is yet another FAQ from Microsoft public SQL Server newsgroups. Lot of SQL Server developers are used to using @@IDENTITY to retrieve the value of the IDENTITY column immediately after inserting a row. We are missing that functionality when it comes to inserting rows with GUIDs as keys. Unfortunately, there's no equivalent to @@IDENTITY, when it comes to GUIDs. Here are three ideas to help you retrieve the GUID value immediately after inserting a row."