Quantcast
Channel: SQL Server Migration forum
Viewing all articles
Browse latest Browse all 1700

sqlcmd restore gives an error

$
0
0

I am trying to restore a database that no longer exists from a backup file with the following

sqlcmd -E -S SERVER -d "master" -n -b -Q "RESTORE DATABASE SOPHOS50 FROM DISK = C:\SOPHOS50.bak WITH REPLACE, RECOVERY"

but I got an error

C:\Users\Administrator>sqlcmd -E -S SERVER -d "master" -n -b -Q "RESTORE D
ATABASE SOPHOS50 FROM DISK = C:\SOPHOS50.bak WITH REPLACE, RECOVERY"
Sqlcmd: Warning: '-n' is an obsolete option and is ignored.
Msg 102, Level 15, State 1, Server SERVER, Line 1
Incorrect syntax near 'C:'.
Msg 319, Level 15, State 1, Server SERVER, Line 1
Incorrect syntax near the keyword 'with'. If this statement is a common table ex
pression, an xmlnamespaces clause or a change tracking context clause, the previ
ous statement must be terminated with a semicolon.

any idea?


Viewing all articles
Browse latest Browse all 1700

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>