>On SQL server the keys are kept in a table. The stored procedure just increments the key, then returns it to the client. You'll want wrap this in a transaction of better isolation. On the client side, I just increment an Appication property that holds an integer.
>
Charlie,
In this scenario, when a user creates a "new" record, the client generates a new key and appends a blank record into a cursor. When the user hits "save", the values are sent to the server via a stored procedure.
What about a scenario where multiple values are sent to the client. The user edits some, deletes some, and then adds a few new records. What method do you use to distinguish between the three types of transactions when the data is saved? In this scenario, views can simplify things a bit, although I'm sure it would take only a little bit of coding to get around it.
Also, do you generate a single incremented value for every table? If so, it might be easier to simply create a GUID.
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