Attatching and detatching Database

  • Can you kindly let me know the easiest and safest to way to detach and attach a database. I have never attempted this procedure and would like to get it right this first time as I am going to be doing this on one of our production servers!!!!!

  • The best way is always with T-SQL. Check BOL for sp_attach_db and sp_detach_db. To detach the db use sp_detach_db Dbname, then move the data files or what ever you want, and then use sp_attach_db with the name of the db, or a new name, and the complete path of all the data files.

  • The easiest is by using Enterprise Manager. Select the database, right-click, go to All Tasks, and select detach database.

    -SQLBill

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply