syntax problem!help wanted!
I have two databases db1 and db2.
I am trying to restore these databases to backups using c++ app.
The app checks if db2 backup file is present or not. DB2 restore is attempted automatically if someone tries to restore db1. (it is jsut like that)
if the user does not have backup file for db2 then i try to restore db2 to backup file of db1 using following sql
"RESTORE DATABASE DB2 FROM DISK = 'c:\Program Files\Microsoft SQL Server\MSSQL\Backup\DB1.Backup.dat' With Move 'DB1Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\DB2Data.mdf', 'DB1Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\DB2Data.mdf', REPLACE"
when i try to execute hte sql server gives a syntax error
and I have consulyt4ed books and stuff but did not see nay problems.
can anyone help me?
thanks

