SQL SERVER - Incorrect syntax issue (Restore DB from .dat file)

Hi EE,

I am trying to restore a DB from a .dat file with the following code:

Restore Database ARRCSAurion11022018
from Disk = 'J:\SQL Flat Files\SQAURION01\Aurion_data_dump.dat'
With Recovery;
MOVE 'ARRCSAurion11022018_data' TO 'F:\SQLData\ARRCSAurion11022018_data.mdf'
MOVE 'ARRCSAurion11022018_log' TO 'I:\SQLLogs\ARRCSAurion11022018_log.ldf'

Open in new window


I get a syntax error on line 4.

Any assistance is appreciated running SQL server 2016.

Thank you.
ZackGeneral IT Goto GuyAsked:
Who is Participating?
 
Ares KurkluConnect With a Mentor Software EngineerCommented:
You may want to do what it says and check the names,
this will show you a list of files that were backed up

RESTORE FILELISTONLY FROM DISK = 'J:\SQL Flat Files\SQAURION01\Aurion_data_dump.dat' WITH FILE = 1

you may not be looking for the first backup but you can try that.
0
 
Ares KurkluConnect With a Mentor Software EngineerCommented:
I think you need a comma and replace the ";" with comma as well, can you please try this:
Restore Database ARRCSAurion11022018
from Disk = 'J:\SQL Flat Files\SQAURION01\Aurion_data_dump.dat'
With Recovery,

MOVE 'ARRCSAurion11022018_data' TO 'F:\SQLData\ARRCSAurion11022018_data.mdf',
MOVE 'ARRCSAurion11022018_log' TO 'I:\SQLLogs\ARRCSAurion11022018_log.ldf'

Open in new window

0
 
ZackGeneral IT Goto GuyAuthor Commented:
Hi Ares,

Okay now I am getting the following error message:

Msg 3234, Level 16, State 2, Line 1
Logical file 'ARRCSAurion11022018_data' is not part of database 'ARRCSAurion11022018'. Use RESTORE FILELISTONLY to list the logical file names.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.


Thank you.
0
 
ZackGeneral IT Goto GuyAuthor Commented:
Hi Ares,

Thank you, that got it, unfortunately, I don't have enough space to restore :)
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.