Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Proper Restore MS SQL.bak

Posted on 2008-10-14
6
Medium Priority
?
238 Views
Last Modified: 2012-05-05
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


0
Comment
Question by:JaimeJegonia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 22711496
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
 
LVL 60

Accepted Solution

by:
chapmandew earned 2000 total points
ID: 22711529
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
 
LVL 60

Expert Comment

by:chapmandew
ID: 22711539
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 40

Expert Comment

by:Richard Quadling
ID: 22711653
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
 
LVL 60

Expert Comment

by:chapmandew
ID: 22711665
Nope, it would have just thrown a syntax error.
0
 

Author Closing Comment

by:JaimeJegonia
ID: 31505884
That's great!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question