• My question:

    Is it possible to schedule a nightly process to disconnect all live connections to a database? I am asking this because sometime we need to detach databases for maintenance requirements, and re-attach them again.

    I am new to SQL server to be honest, and I personally prefer to use TOAD for SQL Server (a front-end from Quest software).

    Thanks in advance and look forward to learning a lot here.

    Cheers from Australia! 🙂

    -------

    Here's one way. There are several options and this may not be the best, link is included for your reference.

    This will set the database offline, and rollback any transactions in progress immediately, assuming you can.

    ALTER DATABASE [DBNAMEgoesHERE] SET OFFLINE WITH ROLLBACK IMMEDIATE

    http://msdn.microsoft.com/en-us/library/bb522682.aspx

    Hope that helps? Aloha! 🙂

    --------------------------------------------------
    ...0.05 points per day since registration... slowly crawl up to 1 pt per day hopefully 😀