Dirty Reads

Database
Enthusiast

Dirty Reads

When wishing to do a dirty read in SQLServer I would do this...

Sel *
From Tbl_1(nolock), Tbl_2(nolock)
Where Col1 = Col2....

The equivalent is 'Locking Table For Access' in Teradata but what if I want to use 2 tables like above how does the syntax go?

Is there a locking rows for access command?
2 REPLIES
Enthusiast

Re: Dirty Reads

Yes...

LOCKING ROW FOR ACCESS
SELECT ....

It will escalate the lock to a table level lock when appropriate.

Enthusiast

Re: Dirty Reads

I should have clarified the last sentence:

It will escalate the lock to a table level access lock when appropriate.