none
Can we disable a database (instead of deleting) in SQL Server 2005 ? RRS feed

  • Question

  • Hi,

    We are going to migrate a database to another server but we don't want to delete that database in the old machine BEFORE testing in the new one is successful.

    Is there any way for us to disable access to the database in old machine ?  Can we detach both MDF and LDF files ?

    Your advice is sought.

    Thursday, January 27, 2011 4:15 AM

Answers

  • How about setting it offline?

    ALTER DATABASE databaseName
     SET OFFLINE  -- OFFLINE, ONLINE
     

    Hope that helps

     

     

     


    Best Regards, Jungsun Kim
    • Marked as answer by TonyJK Thursday, January 27, 2011 5:41 AM
    Thursday, January 27, 2011 4:53 AM

All replies

  • How about setting it offline?

    ALTER DATABASE databaseName
     SET OFFLINE  -- OFFLINE, ONLINE
     

    Hope that helps

     

     

     


    Best Regards, Jungsun Kim
    • Marked as answer by TonyJK Thursday, January 27, 2011 5:41 AM
    Thursday, January 27, 2011 4:53 AM
  • you can put the database OFFLINE, or you can DETACH it temporary and can ATTACH as needed.

     


    --------------------------------- Devender Bijania
    Thursday, January 27, 2011 5:08 AM