While interacting with MDF file of MS SQL Server, consider the given scenarios:

  • In MS SQL Server, you use SSMS (SQL Server Management Studio) to query character data from the SQL Server database which uses a non-Unicode data type. For instance, the SQL Server uses the char, varchar or the text data type.
  • The code page of client computer differs form code page of database.

In such circumstances, the character data may be represented incorrectly. For instance, you may face any of the subsequent issues:

  • The characters are represented as the question mark. You might come across this issue if you have inserted or updated character data as non-Unicode data type prior to querying character data.
  • The characters are represented as corrupted. The characters of code page A are stored in non-Unicode column of code page B. Furthermore, the characters are not translated.

In such circumstances, the MDF file becomes inaccessible due to corruption and might lead to the data loss.

Reasons of the trouble

This crisis occurs as the characters of code page are stored in non-Unicode column of page B. In addition, the characters are not translated properly.

In SQL Server, when you use the string literal of non-Unicode data type, the string literal is changed by using the default code page of the database which is derived from collation of the database. Storing the character data of code page in a column of B code page might result into database corruption and data loss.

Resolution

To stop the database corruption and work around this issue, you may try the following:

  • Use a Unicode data type in place of non-Unicode data type
  • Use appropriate collation for SQL database
  • Use binary or varbinary data type
  • Use a diverse tool for storing and accessing data and disable data Translate parameter

These fixes will stop the database corruption but won’t be able to repair the corrupted database. To do so, you need to use SQL repair software.

Stellar Phoenix SQL Database Recovery is the highly developed and the best ever made MDF recovery software, capable of repairing and restoring all of the MDF objects such as tables, reports, forms, macros, data types and so forth.

This outstanding MDF repair software deploys the most powerful scanning mechanism to end absolute SQL repair. The user interface of this SQL recovery software is extremely interactive and simple and doesn’t require any sound technical knowledge to carry out MDF recovery.