Gejala:

Nalika nyoba masang database .MDF ing SQL Server, sampeyan ndeleng pesen kesalahan ing ngisor iki:

Pasang basis data gagal kanggo 'xxx' Server. (Microsoft.SqlServer.Smo)

Ana pangecualian nalika nglakokake pernyataan utawa batch Transact-SQL. (Microsoft.SqlServer.ConnectionInfo)

Header kanggo file 'xxx.mdf' dudu header file database sing bener. Properti SIZE FILE salah. (Micosoft SQL Server, Kesalahan: 5172)

ing endi 'xxx.mdf' minangka jeneng file MDF sing bakal dilampirake.

Tangkapan layar pesen kesalahan:

Penjelasan sing Tepat:

Data ing file MDF disimpen minangka kaca, saben kaca 8KB. Kaca kapisan diarani kaca header file, sing ngemot most informasi penting babagan kabeh file, kayata teken file, ukuran file, kompatibilitas, lsp.

Yen kaca header file MDF rusak utawa rusak, lan ora bisa dingerteni dening Microsoft SQL Server, banjur SQL Server bakal mikir header ora valid lan nglaporake kesalahan iki.

Sampeyan bisa nggunakake produk DataNumen SQL Recovery kanggo mbalekake data saka file MDF sing rusak lan ngatasi kesalahan iki.

File Sampel:

Sampel file MDF rusak sing bakal nyebabake kesalahan:

SQL Server versi File MDF sing rusak File MDF didandani dening DataNumen SQL Recovery
SQL Server 2005 Kesalahan2_1.mdf Kesalahan2_1_fixed.mdf
SQL Server 2008 R2 Kesalahan2_2.mdf Kesalahan2_2_fixed.mdf
SQL Server 2012 Kesalahan2_3.mdf Kesalahan2_3_fixed.mdf
SQL Server 2014 Kesalahan2_4.mdf Kesalahan2_4_fixed.mdf