MonsterRocks (1/9/2011)
CREATE TABLE #TAB2 (SNO INT, UNQ_ID BIGINT)
INSERT INTO #TAB2 VALUES(1,10)
i have to increament the value of UNQ_ID by 1 and assign it in one variable....
how it is possible to do it in same time?.. after updating, if i use select statement someother user may update the record... so anybody pls suggest me a better to achieve it?..
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 Moden
Change is inevitable... Change for the better is not.