Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Montreal, Canada

    Question Unanswered: Change location of an Existing DB in MSDE

    Hi everyone,

    I have an MSDE database that was created using the osql.exe. By default it gets automatically created in the MSSQL7/data directory.

    Does anyone know how i can detach and then re-attach the database from a new location?

  2. #2
    Join Date
    Aug 2002
    Refer to SP_ATTACH_DB & SP_DETACH_DB topics in books online.

    Also you can mention path for data files while using CREATE DATABASE Statement.
    --Satya SKJ
    Microsoft SQL Server MVP

  3. #3
    Join Date
    Jan 2003
    Nottinghamshire, UK
    Have U thought of

    1)Backup db
    2)copy the mdf & ldf files
    3)delete the db
    4)create a new db with same name but data files in the new place
    5)overwite the new files (s'be same name) with the original files
    (Don't know if u have to stop the SQL Service to do this bit)

    or do 1) 3) & 4) + restore db

    Worth a try

    Ye Hah !

    "Everything should be made as simple as possible, but not simpler." - Albert Einstein
    "Everything should be made as complex as possible, so I look Cleverer." - Application Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts