Up Prev Next
From: Doug Fairclough <kensey at clearstation dot com>
Subject: next key table
Date: Sep 18 1997 5:28PM
states that :
update next_key set next_key = next_key + 1
select @next_key = next_key + 1 from next_key
insert into data_table (key_column, ...) values (@next_key, ...)
does anyone know if its necessary to have the 'insert' statement
_within_ the transaction in order to gaurantee uniqueness in the
keys generated ?
i have code that does the above, but i dont have my insert statements
within 'begin tran' and 'commit tran' but after it.