Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 lock in select

Author  Topic 

CrazyT
Yak Posting Veteran

73 Posts

Posted - 2010-06-21 : 11:45:22
I have told using lock in a select statement will speed up the query. is this correct?

Kristen
Test

22859 Posts

Posted - 2010-06-21 : 13:13:14
No. Maybe they meant "NOLOCK"? That would probably speed it up, but it is an extremely bad idea unless you know exact what happens, and how you will have to change you application to accommodate it.

If you are SQL2005 or later then enabling READ_COMMITTED_SNAPSHOT for your database may help, particularly if you also have problems with Writes being Blocked (i.e. by Reads)

Other than that, you need to optimise any slow running queries. Folk here will be happy to help you with that task.
Go to Top of Page
   

- Advertisement -