Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
@@identity for uniqueidentifier data type
Message
 
 
À
05/07/2010 11:53:08
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
01471416
Message ID:
01471419
Vues:
40
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform