Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Exclusive Locking

Author  Topic 

amitmnagarwal
Starting Member

15 Posts

Posted - 2009-04-13 : 07:14:32
The SQL table I am trying to write data to has a sequential id a its primary key In the mapping I am returning the max value and adding 1 to it for each row. The problem I encountered i that another application inserted a record in the middle of th job, causing my session to fail due to a duplicate key&H2E I there a way to lock the table for the job or another recommende approach to prevent this from happening?

suggest a way where i can obtain exclusive lock of the table so that there is no disscepancy in data.

ayamas
Aged Yak Warrior

552 Posts

Posted - 2009-04-13 : 07:19:01
But it in transactions.
Go to Top of Page
   

- Advertisement -