Link to home
Start Free TrialLog in
Avatar of QPR
QPRFlag for New Zealand

asked on

rename mdf and ldf

I restored a DB from a backup of a different DB (same structure just the name is different e.g. MyDB and MyDBTest).
Usually I do this via a script but I got lazy and used the EM GUI.
All works well but the mdf and ldf are called MyDB_data.mdf and MyDB_log.ldf
How can I rename them to MyDBTest_data.mdf and MyDBTest_log.ldf

This is a test area at the moment so I have no issues with stopping services, kicking people out etc.
Avatar of QPR
QPR
Flag of New Zealand image

ASKER

Panic over. The mdf and ldf in the file system were named correctly.
I just had to use:
alter database myDB
MODIFY FILE (NAME = MyDB_data, NEWNAME = MyDBTest_data)

ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial