Click here to Skip to main content
15,905,781 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
While trying to restore my database with move option getting error .
restore database CorruptDemoDataPurityfrom disk='E:\backup\CorruptDemoDataPurity.bak'
with move 'SalesDBData' to'D:\backup\DemoDataPurity.mdf'
, move 'SalesDBLog' to 'D:\backup\DemoDataPurity_log.ldf',replace
Error:
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'disk'.
Msg 319, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xml namespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
Posted
Updated 1-Feb-16 23:04pm
v2
Comments
ZurdoDev 2-Feb-16 7:26am    
Just google for the proper syntax.
Dave Kreskowiak 2-Feb-16 7:38am    
What's the command you used to do the restore? According to the error message there's a syntax error in what you typed.

Please check MSDN site for the syntax.
RESTORE (Transact-SQL)[^]
 
Share this answer
 
SQL
restore database CorruptDemoDataPurityfrom disk=...

If that's what you actually typed, then you're missing a space between the database name and the FROM:
SQL
restore database CorruptDemoDataPurity from disk=...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900