Thursday, March 29, 2012

correct syntax for ALTER DATABASE MODIFY FILE

Hi All,
I get an error "Incorrect syntax near FILE" when I try to execute the
following
ALTER DATABASE MODIFY FILE (NAME = MasterDB, NEWNAME = CompanyDB)
What could be wrong with this and how can I fix it.
ThanksYou need to specify the desired database name. Try:
ALTER DATABASE CompanyDB
MODIFY FILE (NAME = 'MasterDB', NEWNAME = 'CompanyDB')
Hope this helps.
Dan Guzman
SQL Server MVP
"Jason Fischer" <jason.fischer@.micropay.com.au> wrote in message
news:%23XED$JXkFHA.4028@.TK2MSFTNGP10.phx.gbl...
> Hi All,
> I get an error "Incorrect syntax near FILE" when I try to execute the
> following
> ALTER DATABASE MODIFY FILE (NAME = MasterDB, NEWNAME = CompanyDB)
> What could be wrong with this and how can I fix it.
> Thanks
>|||Thanks Dan.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:%231iIzlXkFHA.1204@.TK2MSFTNGP12.phx.gbl...
> You need to specify the desired database name. Try:
> ALTER DATABASE CompanyDB
> MODIFY FILE (NAME = 'MasterDB', NEWNAME = 'CompanyDB')
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Jason Fischer" <jason.fischer@.micropay.com.au> wrote in message
> news:%23XED$JXkFHA.4028@.TK2MSFTNGP10.phx.gbl...
>> Hi All,
>> I get an error "Incorrect syntax near FILE" when I try to execute the
>> following
>> ALTER DATABASE MODIFY FILE (NAME = MasterDB, NEWNAME = CompanyDB)
>> What could be wrong with this and how can I fix it.
>> Thanks
>

No comments:

Post a Comment