Solved

Proper Restore MS SQL.bak

Posted on 2008-10-14
6
216 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
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
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
Comment Utility
Nope, it would have just thrown a syntax error.
0
 

Author Closing Comment

by:JaimeJegonia
Comment Utility
That's great!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sql calculate reminders 11 56
SQL Query 2 56
SQL Encryption question 2 40
Pivot Query Problem 9 30
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
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 …
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now