How to put NO LOCK for stored procedure T-SQL for all tables

Viewed 33867

I want that my tables will not be locked. Is it possible to set NO LOCK for all tables in the stored procedure. What is the best way if I have a lot of tables like this:

select * from t1
join t2 ..
join t3 .. with (nolock)

select * from t4
join t4 ..
join t5 etc...
 with (nolock)
2 Answers

If dirty reads are a problem you may look into using 'Isolation level Snapshot': this creates a regular snapschot of your database and uses that for calculation. Downside is that this copy requires extra memory.

Related