Created
June 17, 2010 14:41
-
-
Save jhleath/442210 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; | |
BEGIN TRANSACTION; | |
Declare @counter int | |
select @counter = counterID from myTable order by counterID asc | |
select @counter = @counter + 1 | |
INSERT INTO myTable (counterID) VALUES (@counter) | |
Select @counter as newCounterID | |
COMMIT TRANSACTION; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment