Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
@@identity for uniqueidentifier data type
Message
 
 
To
05/07/2010 11:53:08
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
01471416
Message ID:
01471419
Views:
39
>HI all
>
>Is the a @@identity or SCOPE_IDENTITY() that will work when using uniqueidentifier and newid() for my pk. I would like to get back the new PK when a row is inserted.
>
>Thanks.

No. There are two ways to get this info.

1. Set the ID yourself using NewID() and pass it to INSERT command

2. Using OUTPUT clause of INSERT command (SQL Server 2005 and up only). See details in BOL.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform