alternative to nolock to avoid blocking trans

  • How can I avoid obtaining locks but also be sure I'm only returning committed data?

    We've got alot of long running queries coming off of vldbs - 3-5 G average. We often get what should be read only procs claiming locks on objects. I don't want to deal with the bugs involved with the nolock hint.

  • How are you obtaining the resultsets? If from ADO, be sure to set the IsolationLevel of the ADODB.Connection object to ReadUncommitted. If from SQL, then you can issue a SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED command at the start of your batch. More in BOL.

    HTH,

    Jay

  • Most of it is generated in stored procedures. I want to honor other locks that are on the data. But, while those locks from other procs are in place, I want to be able to read the data and be sure not to issue locks...except perhaps on schema. I don't want to issue any new locks on the data with these reporting procedures.

  • coverston

    you want the select to honor locks - but you want to read the locked data?? - that seems like a bit of contradiction to me .. In case i've got you wrong - would READPAST help - this would just skip the locked rows???

  • Sorry - yes understand what you mean now - READPAST would probably issue a lock itself..

    can't think of anything that will do what you are asking for

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply