• When restoring a database or doing any kind of structural maintenance for that matter, the only seesion that should have access to the database is the restore or maintenance session itself. So, setting the database iinto RESTRICTED_USER is not really recommended for database restore or maintenamce operations. This is because that mode allows more than one person to connect to the database if more that one person are members in the sysadmin, db_owner, or dbcreator roles for that database on your db server.. On many boxes, there is usally more than one member in those roles. So, that is not really what you want here. What you should use for any database maintenance operations is SINGLE_USER mode. That makes absolutely sure no one else can access that sataabase while you have it down for maintenance. Much safer. 😀

    ALTER DATABASE database SET SINGLE_USER WITH ROLLBACK IMMEDIATE

    GO

    "Technology is a weird thing. It brings you great gifts with one hand, and it stabs you in the back with the other. ...:-D"