Sunday, March 25, 2012

Changing the file name stored in database properties

I need to change the file name of a database.
The name I need to change is shown when you right click on a database and
select properties then select the Data File tab.
I need to change the filename associated with the database.
Is this possible and how
Regards
Jeff
--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003Jeff,
The filename you mentioned is the "logical filename".Why I clarified is
because, normally the xxxx.mdf is referred as filename of data file.As Kalen
mentioned, you can change the logical filename only in SQL2000 and the
command is:
ALTER DATABASE <databasename>
MODIFY FILE (NAME= '<oldlogicalfilename>', NEWNAME = '<newlogicalfilename>')
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Jeff Williams" <jeff.williams@.hardsoft.com.au> wrote in message
news:eUENlIfXDHA.2484@.TK2MSFTNGP09.phx.gbl...
> I need to change the file name of a database.
> The name I need to change is shown when you right click on a database and
> select properties then select the Data File tab.
> I need to change the filename associated with the database.
> Is this possible and how
> Regards
> Jeff
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003
>

No comments:

Post a Comment