• An extreme warning needs to be added to this. If you set the database to single user from SSMS, then only THAT session can do anything with the database. You can't even use the explorer window because that's a different session. But, that's NOT the worst of it. If you make the mistake of closing the session that set the DB to single user, you stand a huge chance of a Web Service other some other functionality grabbing that single connection and you won't be able to change it without killing EVERYTHING that touches the database. If you can't find all of that stuff, then it may require a reboot in the "maintenance" mode so that you can actually fix it.

    So, here's the warning...

    [font="Arial Black"]DO NOT CLOSE THE CURRENT SESSION IF IT IS THE SESSION THAT SET THE SINGLE USER MODE!!![/font]

    😉

    --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)