Re: Renaming DB

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thank you Russell.

So far,
I renamed the DB using:
alter database <OLD_DB> modify name= <NEW_DB>

I renamed the data and log files using the MS link

But when I check the properties of the NEW_DB using the server manager, tabs
Data Files and Transaction Log,
it still shows the old name OLD_DB_Data and OLD_DB_Log in the "File Name"
field (even though the location bears the new name).

Any idea.

Thank you again

Eric

"Russell Fields" <russellfields@xxxxxxxxxx> wrote in message
news:OdzWcqBxJHA.956@xxxxxxxxxxxxxxxxxxxxxxx
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
    ... As Kevin mentioned, you must detach the database, move the file, then reattach. ... you can only rename o/s files for tempdb and then it only takes effect after a restart. ... The new tempdb file name takes effect only after SQL Server is stopped and restarted. ... If the file is on a raw partition, os_file_name must specify only the drive letter of an existing raw partition. ...
    (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: Backup Question
    ... to rename the data and log files to the original names ... Rename files on disk. ... Start SQL Server. ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.security)