uniqueidentifier column

From: Fernando Chilvarguer (fernando_at_nospam-impex.com)
Date: 07/14/04


Date: Tue, 13 Jul 2004 21:00:18 -0700

I'm using a uniqueidentifier column as the "identity" primary key column for
a table.
How can I retrieve the value of that column after an insert (using NEWID())?
I tried something like:
"INSERT INTO TABLE........... SELECT @@Identity"
The @@Identity does not work in this case. It returns NULL

Thanks,
Fernando Chilvarguer



Relevant Pages

  • Retrieving autoincrement field from SQLite using DBI
    ... When you use DBI to add a new record to a SQLite table, for which the primary key column uses AUTOINCREMENT, is there a way to retrieve what was the ID value generated for the record you just added? ...
    (comp.lang.perl.misc)
  • Re: Retrieving autoincrement field from SQLite using DBI
    ... Steve wrote: ... the primary key column uses AUTOINCREMENT, is there a way to retrieve what was the ID value generated for the record you just added? ...
    (comp.lang.perl.misc)
  • uniqueidentifier column
    ... UniqueIdentifier. ... It must use newid() only. ... >How can I retrieve the value of that column after an ...
    (microsoft.public.sqlserver.programming)