Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Incorrect syntax near the keyword 'FILE'

$
0
0

I am trying to move SQL Server 2008 system data bases to a new location.

Here is the code I am using for the first step:

USE master
GO


--ALTER temdb
ALTER DATABASE
MODIFY FILE (NAME = 'tempdev',FILENAME = 'Q:\MSSQL10_50.MSSQLSERVER-DATA\tempdb.mdf')

ALTER DATABASE
MODIFY FILE (NAME = 'templog',FILENAME = 'Q:\MSSQL10_50.MSSQLSERVER-DATA\templog.ldf')


--ALTER model
ALTER DATABASE
MODIFY FILE (NAME = 'modeldev',FILENAME = 'Q:\MSSQL10_50.MSSQLSERVER-DATA\model.mdf')

ALTER DATABASE
MODIFY FILE (NAME = 'modellog',FILENAME = 'Q:\MSSQL10_50.MSSQLSERVER-DATA\modellog.ldf')


--ALTER msdb
ALTER DATABASE
MODIFY FILE (NAME = 'MSDBData',FILENAME = 'Q:\MSSQL10_50.MSSQLSERVER-DATA\MSDBData.mdf')

ALTER DATABASE
MODIFY FILE (NAME = 'MSDBLog',FILENAME = 'Q:\MSSQL10_50.MSSQLSERVER-DATA\MSDBLog.ldf')

I am getting the following errors:

Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'FILE'.
Msg 156, Level 15, State 1, Line 8
Incorrect syntax near the keyword 'FILE'.
Msg 156, Level 15, State 1, Line 13
Incorrect syntax near the keyword 'FILE'.
Msg 156, Level 15, State 1, Line 16
Incorrect syntax near the keyword 'FILE'.
Msg 156, Level 15, State 1, Line 21
Incorrect syntax near the keyword 'FILE'.
Msg 156, Level 15, State 1, Line 24
Incorrect syntax near the keyword 'FILE'.

Can anyone tell me what I am doing wrong?

Thanks!


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>