Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLServer- Identifier/ AutoInc value and CA
Message
 
 
À
01/06/2007 11:41:41
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
MS SQL Server
Divers
Thread ID:
01229802
Message ID:
01229858
Vues:
11
>>>SQL Server 2005.
>>>I have Integer Identifier column as primary key. Using CA class for Inserts & Updates.
>>>
>>>How do I get the new ID created in SQl Server in my VFP Cursor?
>>>
>>>The prob is similar to the VFP problem discussed in Thread #1191628 and solved in Message #1191764.
>>
>>Found this article http://sqlservercode.blogspot.com/2006/10/hello-output-see-you-later-trigger-or.html
>
>Nice to have feature, but the CA won't use the Output from the Output clause anywhere.
>
>The equivalent to
>InsertCmdRefreshCmd = "SELECT Id FROM Table1 WHERE Id = GETAUTOINCVALUE(0)"
>
>to a CA connected to SQL Server 2000 or higher should be
>InsertCmdRefreshCmd = "SELECT Id FROM Table1 WHERE Id = IDENT_CURRENT('Table1')"
>
>Bye, Olaf.

I don't think you should use IDENT_CURRENT in multi-user application. How can you guarantee it's the last record added by this user?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform