Re: Backup Question
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 21:55:06 +0000 (UTC)
ExcelMan (sfarkas@xxxxxxxxx) writes:
So I have solved one problem -- elimination of extraneous files -- but
I still have file names that are not what I want. Is there now a way
to rename the data and log files to the original names
(DatabaseName_Data.MDF and DatabaseName_Log.LDF) and get everything
back the way it was?
Do this:
1) ALTER DATABASE db MODIFY FILE
(NAME = 'DatabaseName',
FILENAME = 'C:\Program Files\...\DatabaseName_Data.MDF)
2) Same operation for the log file.
3) Stop SQL Server.
4) Rename files on disk.
5) Start SQL Server.
To know what to put in the NAME field, run sp_helpdb and get the names
from the second column.
Then again, I could really care less what the physical names of my
database files are.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: Backup Question
- From: bass_player [SBS-MVP]
- Re: Backup Question
- Prev by Date: Re: How can I remove Public access to SQL Express db's?
- Next by Date: Re: Backup Question
- Previous by thread: Re: How can I remove Public access to SQL Express db's?
- Next by thread: Re: Backup Question
- Index(es):
Relevant Pages
|