Re: How to Rename Database Files

From: Kalen Delaney (replies_at_public_newsgroups.com)
Date: 04/23/04


Date: Fri, 23 Apr 2004 14:54:31 -0700

Yes, I just said that John's approach would not change the logical file
names. Earlier in the thread I told the original poster he could use ALTER
DATABASE to change the logical file names.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hari Prasad" <hari_prasad_k@hotmail.com> wrote in message
news:urPajkVKEHA.3704@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> In SQL 2000 the logical file name can be changed by using the below
command.
> The below step is not possible in SQL 7
>
> ALTER DATABASE
> MODIFY FILE
> (NAME = logical_file_name,
> NEWNAME = new_logical_name)
>
> How to change the physical name in both SQL 2000 / SQL 7
>
> 1. detach the database using sp_detach_db <dbname>
> 2. Rename the physical files to new name
> 3. attach the database using sp_attach_db 'dbname','new physical MDF name
> with path','new physical LDF name with path'
>
> Thanks
> Hari
> MCDBA
>
>
> "Kalen Delaney" <replies@public_newsgroups.com> wrote in message
> news:e$uJwLVKEHA.2756@TK2MSFTNGP10.phx.gbl...
> > Hi John
> >
> > Note that this will not change the logical file names. That must be done
> > separately and in SQL Server 7 it is not possible to change the logical
> file
> > names at all.
> >
> > --
> > HTH
> > ----------------
> > Kalen Delaney
> > SQL Server MVP
> > www.SolidQualityLearning.com
> >
> >
> > "John Bandettini" <anonymous@discussions.microsoft.com> wrote in message
> > news:851FB97A-324C-40DD-95D9-3704D66EB621@microsoft.com...
> > > Tim
> > >
> > > Detach the database. Rename the windows files and attach as whatever
> name
> > you like.
> > >
> > > Regards
> > >
> > > John
> >
> >
>
>


Relevant Pages

  • Re: 2nd Post: MSDN Subscriber - Sql Server 2005 Restore from tape fails ...
    ... I obviously don't understand the mechanics of restoring a database from tape ... Use RESTORE FILELISTONLY to list the logical file names. ... Ultrium2 tape drive. ...
    (microsoft.public.sqlserver.tools)
  • Re: Change Logical File Name during Restore Database
    ... >You can't change the logical file name when you do the ... >database, you can use ALTER DATABASE to change the ... >Columnist, SQL Server Professional ... >When I attempt to restore a SQL Server 2000 database ...
    (microsoft.public.sqlserver.server)
  • Re: 2nd Post: MSDN Subscriber - Sql Server 2005 Restore from tape fails ...
    ... Use RESTORE FILELISTONLY to list the logical file names. ... This message is telling you that you cannot MOVE the database with a logical file name 'sec_2008-11-08.mdf'. ... As the error message states - Use RESTORE FILELISTONLY to identify the actual logical file names for the database you are restoring. ...
    (microsoft.public.sqlserver.tools)
  • Re: 2nd Post: MSDN Subscriber - Sql Server 2005 Restore from tape fails ...
    ... After following Jeff's advice and executing a RESTORE FILELISTONLY I realized that the logical file names on the tapes did not have the .mdf / .ldf suffixes. ... I obviously don't understand the mechanics of restoring a database from tape as opposed to restoring from a set of .bak files on the hard drive. ...
    (microsoft.public.sqlserver.tools)
  • Re: 2nd Post: MSDN Subscriber - Sql Server 2005 Restore from tape fails ...
    ... executing a RESTORE FILELISTONLY I realized that the logical file names on ... the RESTORE worked great! ... MOVE N'sec_data_001' TO N'C:\Sql Server ... I obviously don't understand the mechanics of restoring a database from ...
    (microsoft.public.sqlserver.tools)

Quantcast