• use master

    alter database [db_name] set offline with rollback immediate

    I will try this next time I replace a test DB with a copy of production. Makes sense.

    Does a restore automatically set the database online? I'll test when I try it.