MSSQL 3241 HATASI ALIYORUM

EMRE KONYA 1 Reputation point
2020-12-19T13:04:24.773+00:00

TITLE: Microsoft SQL Server Management Studio ------------------------------ An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ ADDITIONAL INFORMATION: The media family on device 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\ETRADE.BAK' is incorrectly formed. SQL Server cannot process this media family. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=09.00.3077&EvtSrc=MSSQLServer&EvtID=3241&LinkId=20476 ------------------------------ BUTTONS: OK ------------------------------

???????

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,961 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 112.7K Reputation points MVP
    2020-12-19T13:18:10.717+00:00

    Three possible reasons:

    1. The file is pure garbage, that is it something else than a backup file from SQL Server.
    2. The file is damaged.
    3. It is a valid SQL Server backup, but produced by a higher version of SQL Server than the one you are using.
    0 comments No comments

  2. CathyJi-MSFT 22,306 Reputation points Microsoft Vendor
    2020-12-21T06:06:29.87+00:00

    Hi @EMREKONYA-129,

    > The media family on device 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\ETRADE.BAK' is incorrectly formed. SQL Server cannot process this media family. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)

    There are many possible reasons for this issue as Erland mentioned, please try to use below steps to resolve your issue.

    1.Run the following script on source and destination SQL Servers, the versions should either match or the destination should have a higher version of SQL Server otherwise you cannot restore the .bak file:

    SELECT @@Version  
    

    If you want restore a .bak file from higher SQL version to lower version, you can script out database in compatibility mode using Generate script option as below screenshot. Right click source database ->Task-> Generate scripts. Then run the scripts in destination SQL to create the same database.

    49860-screenshot-2020-12-21-114016.jpg

    2.Please using RESTORE VERIFYONLY to confirm if the backup file is corrupt. For Example;

    RESTORE VERIFYONLY  
    FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL15.SQL2019\MSSQL\Backup\test1.bak'  
    GO  
    

    If the .bak is corrupt, you can re-backup the database again then restore or use SysTools SQL Server BAK File Repair Tool to repair & recover corrupt .bak file.

    Best regards,
    Cathy


    If the response is helpful, please click "Accept Answer" and upvote it, thank you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.