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
 General SQL Server Forums
 New to SQL Server Programming
 blocking

Author  Topic 

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2010-06-17 : 05:33:43
Hi,

I have created script to check blocking and i want to test it on my local machine (home machine) which is not connected to any domain or Lane. can someone tell me the script in which two process should perform operation on one single table like update and insert simaltanously so that when i run my script i should get the result...

Thanks
Vijay

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-06-17 : 05:43:27
Script 1:

BEGIN TRANSACTION
Update SomeTable SET SomeColumn = SomeColumn+'' -- assuming varchar

Script 2:
SELECT * from SomeTable

Run script 1 first, then script 2. It will be blocked until you go to script 1 and run either a commit transaction or rollback transaction.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -