QPR
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I just had to use:
alter database myDB
MODIFY FILE (NAME = MyDB_data, NEWNAME = MyDBTest_data)