It can be done w/o explicit row lock. See
Re: Next Number generator Thread #
533898 Message #
534192. Using Identity column in your table maybe also an option you should consider.
>I want to lock a row in a table.
>
>I want to create an stored procedure for this task
>
>This table holds correlatives numbers and this what i want to do
>
>1.) Lock the row
>2.) Increment the correlative numer, Column1 = Column1 + 1
>3.) Assign the number to an output parameter.
>4.) Unlock the row
>
>This will prevent duplicating a correlative number.
>
>Can someone help me please.
--sb--