General information
Category:
Coding, syntax & commands
OK. That is basically the same as Rick Strahl does. Thanks for the info.
Alex
>I wrote my routine prior to AutoInc functionality, but still prefer to generate my own
>
>Basically you have a table with the name of the ID, and the ID generated
>In my case the ID name is unique, but if it is not you can include the tablename also to make it unique if necessary
>
>Make a procedure/method that accepts a parameter for the ID
>search for that ID in the table, if not found, add it to the table with your default start value (I use 10000000, just for ascetics)
>If found, lock the record, bump the value, unlock the record, return new value
>
>I don't really think about it much because it's built into my data object
>In my case if I send a record to my data object without a uniqid, it calls the function and generates it automatically and passes back the value,
>
>Your welcome to my code snippet, but it's not difficult to code, and mine may not be generic enough for your use
>
>Good luck
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only