Tamoochin
Tamoochin

Reputation: 9

SQL Server: retrieve data that has been saved as question mark characters?

My problem is that my data in Persian language has been saved as question marks by mistake in choosing correct collation!

Now I need this data. Is there any way to retrieve this data and convert them to Persian language characters? Persian language characters must be saved as UTF like Arabic or Japanese.

Upvotes: 0

Views: 1850

Answers (2)

g.d.d.c
g.d.d.c

Reputation: 47988

Your best bet is to attempt to connect to this database, retrieve the data, and view the actual bytes that were stored. If they are the correct bytes then you may be able to salvage the data. If the bytes are all identical (a repeated string of \x53 over and over if \x53 represented the question mark) then the information is lost.

Upvotes: 1

Aaron Bertrand
Aaron Bertrand

Reputation: 280260

If the data was saved as question marks because you did something like this:

INSERT dbo.table(col) SELECT 'Persian characters';

Instead of:

INSERT dbo.table(col) SELECT N'Persian characters';
-----------------------------^ this N is crucially important!

Then I'm afraid your data is gone. If, however, you are seeing question marks in the output, it may not be the case. Where are you seeing question marks?

Upvotes: 4

Related Questions