Question on locking hints for dynamic SQL

Posts   
 
    
PhilScott
User
Posts: 1
Joined: 09-Dec-2005
# Posted on: 09-Dec-2005 18:07:33   

I'm wondering if there's any capability of the generated entity objects to provide locking hints for dynamically generated SELECT statements. I see that the Transaction object has an argument for IsolationLevel. But, I'm wondering if there's a way to specify the equivelant of a "WITH(NOLOCK)" (for a dirty read) at the select statement level at runtime.

Basically, I'd like to have the power to run SELECTs with dirty reads as appropriate without the overhead of creating lots of transactions.

Is there a way to do this?

Paul.Lewis
User
Posts: 147
Joined: 22-Aug-2005
# Posted on: 10-Dec-2005 04:48:58   

PhilScott wrote:

I'm wondering if there's any capability of the generated entity objects to provide locking hints for dynamically generated SELECT statements. I see that the Transaction object has an argument for IsolationLevel. But, I'm wondering if there's a way to specify the equivelant of a "WITH(NOLOCK)" (for a dirty read) at the select statement level at runtime.

Basically, I'd like to have the power to run SELECTs with dirty reads as appropriate without the overhead of creating lots of transactions.

Is there a way to do this?

Here's the definitive thread on transaction levels and NOLOCK:

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=2482

Frans answers your question about 1/3rd of the way through the thread, but do read it all! smile