Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return GUID key auto-generated in SQL Server
Message
De
21/06/2004 02:26:22
Suhas Hegde
Dental Surgeon
Sirsi, Inde
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00915487
Message ID:
00915568
Vues:
14
>I know this question has been asked a dozen times before, but I can't seem to locate the answer.
>
>My SQL table auto-generates a GUID primary key for newly inserted records. Is there a way for me to grab that value during or after my insert statement?
>
>TIA

Hi not sure If the right way and if this is the way u are looking for but works for me
SQLExec(han,"declare @myvar uniqueidentifier "+;
"set @myvar = newid() "+;
"insert into <mytable> (guid_colmn,anotherfield) values(@myvar,'abcd') " +;
"select @myvar","theguid")
HTHs

suhas
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform