July 16, 2012 at 7:28 am
Hello,
How can I lock a table to prevent user from reading it while deleting and inserting records ?
Thank you
July 16, 2012 at 7:58 am
SQL Server handles this by itself if you use the ISOLATION LEVEL as READ COMMITTED
You can check the below link for more details in Isolation Levels
http://msdn.microsoft.com/en-us/library/ms173763%28v=sql.90%29.aspx
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
July 16, 2012 at 7:58 am
Not much detail to go on...
Put an TABLOCKX hint into the delete and do the delete and insert in a transaction.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply