Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2011-09-28 : 10:09:54
|
Hi, When I use the following code to restore a database I receive the error; - Incorrect syntax near '-'- Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminates with a semicolon. N/B: I have three files to Restore- goprd-rct.mdf - goprd-rct_1.log- test.xml RESTORE DATABASE gprd-rctFROM DISK = 'G:\rct\rct.bak'WITH REPLACE Thank you |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-09-28 : 10:43:45
|
| RESTORE DATABASE [gprd-rct]FROM DISK = 'G:\rct\rct.bak'WITH REPLACE--Gail ShawSQL Server MVP |
 |
|
|
paultech
Yak Posting Veteran
79 Posts |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-09-28 : 11:21:46
|
| No need for a ;, though it is recommended that all statements be terminated with a ;. The error about the WITH was a result of the first, of the - in the database name.--Gail ShawSQL Server MVP |
 |
|
|
|
|
|