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 ret开发者_开发技巧rieve this data and convert them to Persian language characters? Persian language characters must be saved as UTF like Arabic or Japanese.
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?
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.
精彩评论