Home > Archive > MS SQL Server > June 2005 > logical filename









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author logical filename
Tom Reis

2005-06-30, 8:23 pm

Is there a way to change the logival filename of a database? I did a restore
of one database to another and the logical name is the same in the new
database. Thanks.


Ravi

2005-06-30, 8:23 pm

There are no straight forward way to do this. You can edit the sysfiles1
system table and change the logical name of database.

Refer system tables, direct updates
Note: Modifying system tables may corrupt the database.

--
Thanks
Ravi


"Tom Reis" wrote:

> Is there a way to change the logival filename of a database? I did a restore
> of one database to another and the logical name is the same in the new
> database. Thanks.
>
>
>

Hari Prasad

2005-06-30, 8:23 pm

Ravi,

We can do the rename using ALTER DATABASE command from SQL 2000 onwards.

Tom,

For changing the Logical file name see the below command:-

ALTER DATABASE <DBNAME> modify file (NAME = 'old_MDF_NAME', NEWNAME =
'NEW_MDF_NAME')

do the same for LDF file as well.

Note:

We can not change the logical file name in SQL 7. The command will only work
in SQL 2000.


Thanks
Hari
SQL Server MVP




"Tom Reis" <reistom@cdnet.cod.edu> wrote in message
news:u7M9AhbfFHA.2484@TK2MSFTNGP15.phx.gbl...
> Is there a way to change the logival filename of a database? I did a
> restore
> of one database to another and the logical name is the same in the new
> database. Thanks.
>
>



Kalen Delaney

2005-06-30, 8:23 pm

Hi Tom

Please always state what version of the product you are using.

In SQL Server 2000, you can use ALTER DATABASE to change the logical
filename.
You could not do it in SQL Server 7.
Earlier than that, there was no concept of logical files for a database.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www. SolidQualityLearning
.com



"Tom Reis" <reistom@cdnet.cod.edu> wrote in message
news:u7M9AhbfFHA.2484@TK2MSFTNGP15.phx.gbl...
> Is there a way to change the logival filename of a database? I did a
> restore
> of one database to another and the logical name is the same in the new
> database. Thanks.
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com