August 12, 2011 at 9:55 am
I have an SQL Server 2008 database and am trying to store values with non-Latin characters in a table. The column in which I am trying to store the values is nvarchar(100) and has a SQL_Latin1_General_CP1_CI_AS collation.
Following is the INSERT statement:
INSERT INTO tblDSV_AttributeChangeDetectionData VALUES (100700,'914225891','JOR','Historical Monument',1,34,'القلعة');
When I execute the statement in my program or in SSMS I get the following results:
JobIDKeyValueCountryCategoryFileNbrColumnNbrColumnValue
100700914225891JORHistorical Monument134??????
(the above is tab delimited so the column headers/data does not line up)
Can anyone give me an idea of what I need to do to get this to work? Thanks so much!!
August 12, 2011 at 10:08 am
How are you viewing the results?
Running a select query? In an application? Edit top 200 rows in SSMS?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
August 12, 2011 at 10:11 am
Hi Jason,
I am viewing the results using a SELECT * query in SSMS. Also, my application reads the data and writes it to a UTF-8 text file and the ????? appears there as well.
Brad
August 12, 2011 at 10:21 am
When writing it out to text file, I believe you need to use UTF-16.
As for SSMS, I ran into that issue once upon a time and am trying to recall what I did to fix it.
Are you using results to text or results to grid?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
August 12, 2011 at 10:33 am
I guess what you have to ask yourself is if the fonts you are using include the characters encoded in the unicode string. If you have some Chinese characters in there and are attempting to display them using a font which has only Latin characters it will not work; similarly for most languages other than those which use variants of the Latin alphabet (and even for some that do, with some fonts).
You may also find that your platform doesn't provide support for languages using the character sets used in your unicode strings - for example on some (maybe all) platforms the Microsoft fonts which have SE Asian capability are installed by default without the SE Asian characters so that if you need those you have to tell Windows to install support for them.
Tom
August 12, 2011 at 12:34 pm
don't you have to explicitly state you are inserting nvarchar? otherwise there is an implicit conversion wich is incserting the question marks
INSERT INTO tblDSV_AttributeChangeDetectionData VALUES (100700,'914225891','JOR','Historical Monument',1,34,N'??????');
Lowell
August 12, 2011 at 2:09 pm
Thanks so much Lowell! That worked! I knew it had to be something simple, I just couldn't figure it out!
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply