Solved

Proper Restore MS SQL.bak

Posted on 2008-10-14
6
231 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 500 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

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…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

632 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