Hi All,
I am doing some design work on a new system. The plan is to use clustered servers accessing the same backend instance. I want to prepoulate the table with our unique id (for say 5M rows for sake of discussion). Where I am puzzled is how do I guarantee unique ids to the application when both servers are looking for the same next available row? The sql could be something like
select min(id) from table where user_id is null
The trouble our current system runs into is that there are occasions where the users generate the same id which of course messes up the application.
Is this a case where a store procedure would do the insert and return the id to the user is a better solution?
Thanks
Bastien
I wish my computer would do what I want it to do,
instead of what I tell it to do...
I am doing some design work on a new system. The plan is to use clustered servers accessing the same backend instance. I want to prepoulate the table with our unique id (for say 5M rows for sake of discussion). Where I am puzzled is how do I guarantee unique ids to the application when both servers are looking for the same next available row? The sql could be something like
select min(id) from table where user_id is null
The trouble our current system runs into is that there are occasions where the users generate the same id which of course messes up the application.
Is this a case where a store procedure would do the insert and return the id to the user is a better solution?
Thanks
Bastien
I wish my computer would do what I want it to do,
instead of what I tell it to do...