Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1199
  • Last Modified:

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.
0
QPR
Asked:
QPR
1 Solution
 
QPRAuthor Commented:
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)

0
 
GranModCommented:
Closed, 250 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now