I am trying to restore a database from a backup file on a SQL Server 2008 instance using the following SQL command:
BEGIN RESTORE DATABASE [MyDataBase] FROM DISK=@db_location WITH STATS=5, FILE=1, MOVE @db_OldName TO @db_NewFile, MOVE @db_OldLogName TO @db_NewLogFile, NOREWIND, NOUNLOAD, RESTART, RECOVERY END
and it fails with the following error:
Msg 3264, Level 16, State 1, Line 19 The operation did not proceed far enough to allow RESTART. Reissue the statement without the RESTART qualifier. Msg 3013, Level 16, State 1, Line 19 RESTORE DATABASE is terminating abnormally.
If I do not use the RESTART option the backup is successful. On SQL Server 2005 it works even with the RESTART parameter.
Since the SQL command is issued by a program I cannot change it. Is there a way to work around this issues on SQL Server 2008?