Proper Restore MS SQL.bak

can anybody tell and correct why this script:

RESTORE DATABASE JTS
FROM DISK = 'E:\JTS_backup.bak'
WITH Replace,
MOVE 'JTSData.mdf' TO 'G\databases\JTS.mdf'
MOVE 'JTSData.log' TO 'G\Databases\JTS.ldf'

is giving this error:
Incorrect syntax near 'MOVE'.

Thanks


JaimeJegoniaAsked:
Who is Participating?
 
chapmandewCommented:
missing a comma:

RESTORE DATABASE JTS
FROM DISK = 'E:\JTS_backup.bak'
WITH Replace,
MOVE 'JTSData.mdf' TO 'G:\databases\JTS.mdf',
MOVE 'JTSData.log' TO 'G:\Databases\JTS.ldf'
0
 
Richard QuadlingSenior Software DeveloperCommented:
I assume you are missing the : for G:\...
RESTORE DATABASE JTS
FROM DISK = 'E:\JTS_backup.bak'
WITH Replace,
MOVE 'JTSData.mdf' TO 'G:\databases\JTS.mdf'
MOVE 'JTSData.log' TO 'G:\Databases\JTS.ldf' 

Open in new window

0
 
chapmandewCommented:
RQuadling, you are correct, the author was missing the :  But, that wasn't what caused this error...it would have caused an error later down the road once the syntax was confirmed. :)
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
Richard QuadlingSenior Software DeveloperCommented:
Sorry, I got a little over excited in being able to answer an SQL2K5 question!And of course, I ended up looking like a horse jockey who wins but then gets disqualified.
0
 
chapmandewCommented:
Nope, it would have just thrown a syntax error.
0
 
JaimeJegoniaAuthor Commented:
That's great!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.