moving SQL db from one drive to another

  • I currently have a MS SQL server in one drive, I am planing to move it to another drive with more space, can any one help me steps I need to take care of while moving. I am new to this thing and can anyone help me in the steps.

  • Two options.

    1) Detach the database, move the files, reattach the database.

    2) Use the ALTER DATABASE ... ALTER FILE to change the metadata. Take the database offline, move the files, bring the DB back online.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You can move databases as Gail mentioned for user databases. If you need to move system databases, there are other procedures.

  • Good point.

    For moving the system databases, see books online as the method is different for the different system databases.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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