Randy,
I know this doesn't answer your question, but how about using an IDENTITY column instead for your PKs. They are automatically generated by SQL Server and you don't have to do a thing:
CREATE TABLE MyTable
(MyPK bigint NOT NULL IDENTITY.
... rest of the columns)
ALTER TABLE MyTable ADD CONSTRAINT
PK_MyPK PRIMARY KEY CLUSTERED
(MyPK)
~~Bonnie
>Hello all, I use a table to keep track of my primary keys. Basically the table contains a field for the tablename and a field for the next available primary key. Is there a way to lock the sql server record until I update it? Also can I run a loop checking the status of the lock so I can grab another lock as soon as the first lock is complete? Thanks for the help.