Friday, August 15, 2008

Simulate Table Lock situation using a Select statement - SQL Server 2005

Today I wanted simulate a table lock situation in my database using a select statement. It was bit hard for me to do it. I was searching it in web, but couldn't find useful thing. May be I didn't do it in right way. ;)

Anyway I could do it. This is how I did it.

You can write your SQL statement with (TABLOCKX) at the end of SQL statement.

ex: Select * From table_name (TABLOCKX)

I assume you all know how to do the rest of it.

0 comments: