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?

Improve company productivity with a Business Account.Sign Up

x
 
chapmandewConnect With a Mentor Commented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
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.