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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ares KurkluSoftware 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
Ares KurkluSoftware 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ZackGeneral IT Goto GuyAuthor Commented:
Hi Ares,

Thank you, that got it, unfortunately, I don't have enough space to restore :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.