Re: Renaming DB
- From: "Russell Fields" <russellfields@xxxxxxxxxx>
- Date: Thu, 23 Apr 2009 09:51:30 -0400
As Kevin mentioned, you must detach the database, move (or rename) the file, then reattach. Here is a link to the steps: http://support.microsoft.com/default.aspx?scid=kb;en-us;224071
RLF
"Kevin3NF" <kevin@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:%2323QzDBxJHA.1504@xxxxxxxxxxxxxxxxxxxxxxx
I may be wrong, but I think you'll have to detach/rename/attach to change the o/s filenames. According to BOL, you can only rename o/s files for tempdb and then it only takes effect after a restart.
ALTER Database
FILENAME
Specifies an operating system file name. When used with MODIFY FILE, FILENAME can be specified only for files in the tempdb database. The new tempdb file name takes effect only after SQL Server is stopped and restarted.
'os_file_name'
Is the path and file name used by the operating system for the file. The file must reside in the server in which SQL Server is installed. Data and log files should not be placed on compressed file systems.
If the file is on a raw partition, os_file_name must specify only the drive letter of an existing raw partition. Only one file can be placed on each raw partition. Files on raw partitions do not autogrow; therefore, the MAXSIZE and FILEGROWTH parameters are not needed when os_file_name specifies a raw partition.
--
Kevin3NF
SQL Server dude
You want fries with that?
http://kevin3nf.blogspot.com/
I only check the newsgroups during work hours, M-F.
Hit my blog and the contact links if necessary...I may be available.
Twitter: Kevin3NF
"Eric" <eric@xxxxxxxx> wrote in message news:Oopntg4wJHA.5584@xxxxxxxxxxxxxxxxxxxxxxxHello,
I am running SQL 2000 and I just renamed one of my DB using:
alter database <OLD_DB> modify name= <NEW_DB>
The name of the DB did change when I look into the SQL server manager but the name of the data file and the transaction log on the HD are still the same (old name).
Is there a way to rename those files too?
Thank you.
Eric
.
- Follow-Ups:
- Re: Renaming DB
- From: Eric
- Re: Renaming DB
- References:
- Renaming DB
- From: Eric
- Re: Renaming DB
- From: Kevin3NF
- Renaming DB
- Prev by Date: Re: Renaming DB
- Next by Date: Re: Renaming DB
- Previous by thread: Re: Renaming DB
- Next by thread: Re: Renaming DB
- Index(es):
Relevant Pages
|