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.
Author |
Topic |
Kapila Shrestha
Starting Member
4 Posts |
Posted - 2013-03-25 : 01:42:55
|
hello all, im very new member in this forum.hope i will be success to find the answer of my query. My query is: How to unlock the table which is previously locked by the TABLOCK statement in sql server 2005?Thank u all in advance. |
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2013-03-25 : 01:54:38
|
was the previous TABLOCK mentioned inside BEGIN TRAN and COMMIT..??If yes, that will it self release the TABLOCK |
|
|
Kapila Shrestha
Starting Member
4 Posts |
Posted - 2013-03-25 : 02:29:47
|
Thank you so much for your response.Actually i have blocked the table with the sql query: "SELECT TICKET_ID FROM TICKET_TBL WITH (TABLOCK)"; i guess there is no need to begin tran and commit in sql server 2005. Please correct me if im wrong. |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2013-03-25 : 02:41:16
|
quote: Originally posted by Kapila Shrestha Thank you so much for your response.Actually i have blocked the table with the sql query: "SELECT TICKET_ID FROM TICKET_TBL WITH (TABLOCK)"; i guess there is no need to begin tran and commit in sql server 2005. Please correct me if im wrong.
So,you are not able to query the table now.try using "SELECT TICKET_ID FROM TICKET WITH(NOLOCK)". |
|
|
Kapila Shrestha
Starting Member
4 Posts |
Posted - 2013-03-25 : 02:51:18
|
thank you for your response.is the mentioned query:"SELECT TICKET_ID FROM TICKET WITH(NOLOCK)" totally released the locked table.i mean after that can another user locked the same table? |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2013-03-25 : 02:52:54
|
yes they can but,still you will be able to query the table using NOLOCK. |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
|
Kapila Shrestha
Starting Member
4 Posts |
Posted - 2013-03-25 : 07:44:31
|
Thanks both you for your response.I have solved my problem. |
|
|
|
|
|