Re: Renaming DB



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@xxxxxxxxxxxxxxxxxxxxxxx
Hello,

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




.



Relevant Pages

  • Re: Renaming DB
    ... FILENAME can be specified only for files in the tempdb database. ... file must reside in the server in which SQL Server is installed. ... If the file is on a raw partition, os_file_name must specify only the drive ... Is there a way to rename those files too? ...
    (microsoft.public.sqlserver.setup)
  • Re: Renaming DB
    ... file must reside in the server in which SQL Server is installed. ... log files should not be placed on compressed file systems. ... If the file is on a raw partition, ... Is there a way to rename those files too? ...
    (microsoft.public.sqlserver.setup)
  • Re: Renaming DB
    ... which you can change using Alter Database and ... SQL Server dude ... If the file is on a raw partition, ... Is there a way to rename those files too? ...
    (microsoft.public.sqlserver.setup)
  • Re: Renaming DB
    ... SQL Server dude ... you can only rename o/s ... Specifies an operating system file name. ... If the file is on a raw partition, ...
    (microsoft.public.sqlserver.setup)
  • Re: How to Rename Database Files
    ... Once the database is detached, SQL Server can rename the physical files ...
    (microsoft.public.sqlserver.server)