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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Restore Question

Author  Topic 

SQL360
Starting Member

20 Posts

Posted - 2008-09-15 : 17:45:14
RESTORE DATABASE test
--restore filelistonly
FROM DISK = 'D:\BACKUP\test_db_200809150315.BAK'
WITH NORECOVERY,
with MOVE 'tws_dat' TO 'D:\Data\test.mdf',
with MOVE 'tws_Log' TO 'D:\LOG\test_log.ldf'

What is wrong with this above syntax, I am getting incorrect syntax near the keyword 'with'. Thank you.

SQL360

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-15 : 17:51:11
Get rid of the 2nd and 3rd "with". You only need one "with" and then commas.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Yeoh Ray Mond
Starting Member

49 Posts

Posted - 2008-09-16 : 11:35:11
i.e.

RESTORE DATABASE test
--restore filelistonly
FROM DISK = 'D:\BACKUP\test_db_200809150315.BAK'
WITH NORECOVERY,
MOVE 'tws_dat' TO 'D:\Data\test.mdf',
MOVE 'tws_Log' TO 'D:\LOG\test_log.ldf'


Ray Mond
SQLBackupRestore.com - your quick guide to SQL Server backup and recovery issues
SQL Inspect - SQL Server query analysis made simple
SQL Image Viewer - retrieve, view, convert and export images directly from SQL Server, SQLite and Firebird databases.
Go to Top of Page

SQL360
Starting Member

20 Posts

Posted - 2008-09-16 : 19:03:33
It worked now. Thanks all.

SQL360
Go to Top of Page
   

- Advertisement -