Solved

Rename Database File Name and Log?

Posted on 2010-09-13
3
648 Views
Last Modified: 2012-05-10
Please see my attached Screen Shot.
How can I rename the file name to match the database file and log?

Thanks,
Mark
SQL-Rename.jpg
0
Comment
Question by:smithmrk
3 Comments
 
LVL 8

Accepted Solution

by:
san_spy earned 500 total points
ID: 33662752
Do you want to rename the physical file name or logical file name?

If its physical file name..

Detach the database rename the physical files and re attach them.

If its logical names check the below url.

http://support.microsoft.com/kb/814576
0
 

Author Closing Comment

by:smithmrk
ID: 33662838
Your Awsome!
Thanks,
Mark
0
 
LVL 2

Expert Comment

by:uscshaggy
ID: 33662841
You definitely can't just change the name of the file on disk that the db and log use directly.  Two ways to accomplish the name change are:

1. Rename the logical name in the File Name column above in your screenshot to something else (add a 1 to the end), and then add a new file using the File Name you want and the physical file name that matches.  Then delete the original file (through SQL Mgmt Studio) and SQL will migrate all the data to the new file you just created.  If SQL 2000 won't let you delete the first file, then try option 2.

2. Backup and restore the database using the 'RESTORE INTO' option to specify different files on disk to restore into.  This way you keep the logical names and can specify a new physical location.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now