You don't need a record lock in SQL Server to do that. See
Re: Record ID generator question Message #
611104.
>Is there a way to force a record locking in SQL Server?
>
>I have this code which is returning the next primary key on a specific table and I am trying to know if this code can be converted to achieve the same assuming I have the same data structure on SQL Server.
>
<snip>
--sb--