October 1, 2005 at 3:01 am
I want to write literals with 16 bits characters (unicode) in update and insert statements into a nvarchar column but I do not want to have the N letter in front of every literal. The reason is that this syntax is database specific and that is not preferable in the actual application.
Example
INSERT INTO MYTABLE (mycolumn) values ('\u8bed\u8a00');
has to be rewritten
INSERT INTO MYTABLE (mycolumn) values (N'\u8bed\u8a00');
if I want to store the chinese characters and be able to retreive the same characters again.
Can I solve this by reinstalling SQL Server and choose another character set, code page, encoding ....?
Will this be working differently with SQL Server 2005 ? I have been told that SQL Server 2005 will have a better support for UTF-8 but in what way?
Regards
/Lars
October 3, 2005 at 10:20 am
Are you creating these insert statements in your application?
or stored procedures?
No matter, if you don't want to use the N'SomeText'
Then you should parameterize your query, Which by the way is always preferable and not db system specific.
Declare @String Nvarchar(50)
insert into mytable (myStringcol)
Values(@String)
You can solve alot of problems by setting the database coalation, and or the column coalation to the correct language.
Not sure about sql 2k5 support improvements for multilanguage.
October 3, 2005 at 10:34 am
Thank you for your suggestions.
What I need is a way to configure SQL Server to always put all characters in a statement and put them in the column without any conversion.
I understand that we could solve this by rewriting all insert, update and select statements (the compare string parts) but that is currently not an option.
Regards
/lars hagrot
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply