• Since you are going to restore the database anyways - this will work:

    ALTER DATABASE {database} SET OFFLINE WITH ROLLBACK IMMEDIATE;

    Take the database offline, perform your restore - and the database will come back ONLINE when you issue the RESTORE DATABASE {database} WITH RECOVERY; (if you do the RESTORE with NORECOVERY that is...if you don't include it, RECOVERY is the default).

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs