I am trying to restore a database from a backup file on a SQL Server 2008 instance using the following SQL command:

    FROM DISK=@db_location 
    WITH STATS=5, 
    MOVE @db_OldName TO @db_NewFile, 
    MOVE @db_OldLogName TO @db_NewLogFile, 

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?

migrated from stackoverflow.com Jan 21 '12 at 15:02

This question came from our site for professional and enthusiast programmers.


Has this ever worked?

RESTART is only specified when you want to continue an interrupted restore. If you can't change the SQL, then you can only somehow break a first restore to generate an error condition.

Because of this, you can't be sure that it's the same on SQL 2005 unless it happens every time. Or they changed behaviour.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy