• Jeff Moden - 1/10/2011

    Why can't you just add the IDENTITY property to the UNQ_ID column? It will help you avoid a whole lot of headaches including but certainly not limited to the deadlocks that inevitably occur when you try to build your own unique sequences.

    Jeff,

    I think this depends on the type of application. I've never seen any deadlocks using this technique for a Point of Sale system I work with. The cash registers request the next ticket number using this technique. Since there's no way people can check out faster than 1 per minute per cash register, there's no problem

    I would never use this technique to get sequential numbers in a rapid fire environment.

    Todd Fifield