Friday, February 24, 2012

A question about restore database

Hi
I wanted to change the logical file name of the database when I restored
a database from a file.But it raised an error.I want to know can I change
logical file name.Any Answers will be appreciated!
Thanks in advance!
Jack
Hi,
Did you mean to rename the logical name of MDF and LDF. Then use
alter database DBNAME modify file (NAME = 'old_MDF_NAME', NEWNAME =
'NEW_MDF_NAME')
do the same for LDF file as well.
For renaming the database.
alter database OLD_DB_NAME modify name = new_db_name
Note:
This will work only from SQL 2000 onwards. Earlier versions this command
will not work
Thanks
Hari
MCDBA
"jack.lee" <lee_j@.21cn.com> wrote in message
news:eGWYkDGnEHA.2096@.TK2MSFTNGP15.phx.gbl...
> Hi
> I wanted to change the logical file name of the database when I
> restored
> a database from a file.But it raised an error.I want to know can I change
> logical file name.Any Answers will be appreciated!
> Thanks in advance!
> Jack
>
|||When you restore a backup file in Enterprise Manager it gives you the
option of path\folder\filename.
Adrian
jack.lee wrote:

> Hi
> I wanted to change the logical file name of the database when I restored
> a database from a file.But it raised an error.I want to know can I change
> logical file name.Any Answers will be appreciated!
> Thanks in advance!
> Jack
>

No comments:

Post a Comment