Ok thanks!
>You don't need extra locks because everything is done in one UPDATE command.
>
>>Thanks Sergey!
>>
>>How about using RowLock? Do you think it will also help?
>>
>>>You've to modify it a little bit to avoid duplicates. It's also better to return value as an output parameter.
CREATE PROCEDURE GetSeriesNo
>>> (@doccode varchar(10), @seriesno int OUTPUT)
>>>AS
>>>BEGIN
>>>-- DECLARE @seriesno int
>>> Update ccdoc
>>> Set seriesno = seriesno + 1, @seriesno = seriesno + 1
>>> Where doccode = @doccode
>>>-- SELECT @seriesno
>>>END
>>>
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net
CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."