cancel
Showing results for 
Search instead for 
Did you mean: 

Command No Lock statement

Former Member
0 Kudos

Hi

I have a Command running in a report that is taking a long time to run. I realise there could be a number of reasons for this (including poor Command writing skills!) but I have seen the statement of No Locks used somewhere before in a Command but cannot remember the syntax - any pointers please as I think this may help in this instance?

Thanks in advance for your help

Jon

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Only used in SQL server, syntax is

SELECT * FROM Tablename WITH (NOLOCK) WHERE field condition

use with care as not really appropriate for high volume transaction scenarios

http://stackoverflow.com/questions/686724/sql-server-when-should-you-use-with-nolock

Ian

Answers (2)

Answers (2)

0 Kudos

If you are having performance issues I suggest using a Stored Procedure, that way the Server is doing all of the work and sending just the results to CR for formatting. And it's safer also.

Don

abhilash_kumar
Active Contributor
0 Kudos

Hi Jon,

What Database are reporting off of?

Also, how long does that SQL take to run directly against the database via a database client tool?

-Abhilash