Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

Rename a database

$
0
0

This seems like it should be easy, but...

I want to rename a database (from Inventory to Inventory_Bak) and then restore a newer copy of that database (Inventory) from another source. When I rename the database it doesn't change the physical MDF and LDF filenames, so when I try to restore I get the error:

"Restore failed...Inventory.MDF cannot be overwritten. It is being used by database 'Inventory_Bak'. "

How can I rename both the logical and physical names of my database?


Darrell H Burns


Viewing all articles
Browse latest Browse all 5123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>