Set File or FileGroup to READ_ONLY on a busy system.

  • According to Books Online and some testing, I think the answer is probably "NO" but I thought I'd ask just in case someone has an oolie to do it. The question is,

    Is there a way to set a File (NDF, in this case) or FileGroup (I have one file per filegroup in this case) to READ ONLY on a busy system without having to temporarily gain exclusive access to the database by setting the SINGLE_USER mode?

    Thanks folks.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I would imagine not, alter database usually requires an exclusive database lock.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

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