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 |
|
ann06
Posting Yak Master
171 Posts |
Posted - 2009-04-26 : 05:49:18
|
| if i have a transaction similar to this BEGIN TRANSACTIONUPDATE CustomerSET CustomerName=@NameWHERE CustomerID=@CustIDUPDATE CustomerPhoneSET PhoneNumber=@PhoneWHERE CustomerID=@CustIDAND PhoneType=@PTypeCOMMIT TRANSACTIONCustormer table will be locked until CustomerPhone table finishes and the transaction is closed? or as soon the update on customer table finishes then the locks are released?Thanks Team |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-04-26 : 05:51:35
|
Customer table will be locked until CustomerPhone table finishes and the transaction is closed.Webfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
ann06
Posting Yak Master
171 Posts |
Posted - 2009-04-26 : 07:10:14
|
| this is for for the default isolation level right?what if the transaction had Select * from customers will locks also be place there until the finish of the trans? or only update, delete and insert statement will lock z tables for the end of the trans? |
 |
|
|
ann06
Posting Yak Master
171 Posts |
Posted - 2009-04-28 : 03:10:43
|
| any help for the last reply? |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-04-28 : 03:51:30
|
To be sure what happens I advise you to do the following:Open a query windowbegin transdo what you want to test...do no commit / no rollback at this time...open a second query window and test if it is possible to acces the data as you wantgo back to first window and close transYou can do your test this way because each window has its own session.Hope that would helpWebfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|