Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>1. Use the "UniqueIdentifier" data type within SQL Server and the "Identity Increment" property. The problem lies in ensuring that I return a GUARANTEED unique record id.
You can't do that. Auto increment only works with integer fields.
I think the best bet is to use the UniqueIdentifier data type for you PK... then generate the GUID value on the client side before inserting your record. (If you are using remote views, the equivelent data type would be Binary Character 16 bytes.)
Just for the heck of it use the default value of NewID() in SQL Server which will create a GUID.
There is a function to create GUID values on the Wiki.
The reason I like this method is because you don't have to make a trip to the server to get an id value.
BOb
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement