FIX: Restore of a Database Gives Error 4038 Due to Malformed Media Set

This article was previously published under Q279823
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 57987 (SQLBUG_70)
When a database is backed up to multiple disk files, and one of the files in the backup set is deleted and then used again in the same backup set to back up a database, a restore of the database using this backup set may fail with the following message:
Server: Msg 4038, Level 16, State 1, Line 1
Cannot find file ID 1 on device 'd:\north2.bak'.
Server: Msg 3013, Level 16, State 1, Line 1
Backup or restore operation terminating abnormally.
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
274799 INF: How to Obtain Service Pack 3 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.
More information

Steps to Reproduce Behavior

To reproduce this problem, follow these steps:
  1. Execute the following command from Query Analyser:
    BACKUP DATABASE northwind to DISK = 'd:\north1.bak', DISK =    'd:\north2.bak' WITH FORMAT
  2. Delete north2.bak.
  3. Execute the following command:
    BACKUP DATABASE northwind to DISK = 'd:\north1.bak', DISK = 'd:\north2.bak' WITH NOINIT
  4. Attempt to restore the database:
    RESTORE DATABASE northwind FROM DISK = 'd:\north1.bak', DISK = 'd:\north2.bak'WITH REPLACE					
    You should see the error listed in the "Symptoms" section.
4038 media set restore

Article ID: 279823 - Last Review: 11/02/2013 01:08:00 - Revision: 3.0

Microsoft SQL Server 7.0 Standard Edition

  • kbnosurvey kbarchive kbbug kbfix KB279823