Skip to main content
rhpt
Known Participant
September 13, 2011
Question

cfquery, nolock, and cftransaction

  • September 13, 2011
  • 1 reply
  • 786 views

A co-worker informed me the other day that using NOLOCK in a cfquery is pointless if you do not include the query inside a cftransaction. He claims that SQL Server will only recognize NOLOCK inside a transaction and thus not having the query within a cftransaction makes the NOLOCK redundant.


Can someone confirm is this is true or not, because in all the CF shops in which Ive worked , NOLOCK is used generously, and it is rarely ever inside a cftransaction. Am I supposed to think that all those queries in all those shops are not actually respecting the NOLOCK?

    This topic has been closed for replies.

    1 reply

    Inspiring
    September 13, 2011

    cfquery sends an sql string to the db.  If that string includes No Lock, the db will react accordingly.