problem with greek encoding while inserting sql server
Ive got text file with utf-8 encoding with more then 2k lines of insert command. Now I would like to execute it as a sql script to insert data into database.
There is greek text with which there are problems. After inserting there are only ? characters, no greek letters.
sample insert statement is presented below:
INSERT INTO myDB.[MC_LIST]
([id], [data], [author], [created], [language], [type_name], [position])
V开发者_如何转开发ALUES
('2086','<data><id>1</id><language>gr</language><szonelinkdest>/products/how-does-nioxin-works-page.aspx</szonelinkdest><szoneimgalt>alt</szoneimgalt><title>ΠΡΟΣΕΓΓΙΣΗ ΦΡΟΝΤΙΔΑΣ ΤΗΣ ΕΠΙΔΕΡΜΙΔΑΣ</title><szoneimg>/m/photo/box-4.jpg</szoneimg><szonedesc>Κάθε προϊόν lala περιέχει έναν εξειδικευμένο συνδυασμό συστατικών επιστημονικής προέλευσης. </szonedesc><szonelinkname>ΟΙ ΤΕΧΝΟΛΟΓΙΕΣ ΜΑΣ</szonelinkname><szonetitle>ΠΡΟΣΕΓΓΙΣΗ ΦΡΟΝΤΙΔΑΣ ΤΗΣ ΕΠΙΔΕΡΜΙΔΑΣ</szonetitle></data>',null,'4/15/2011 3:47:47 PM','gr','1','2') ;
What to do to make it work ?
thanks for any help.
Btw do You know any software which can convert utf-8 file to utf-16 file ?
First, your destination columns need to be able to store unicode data. These are nvarchar(), ntext, nchar.
Second, try prefixing the string containing cyrillic characters with N for unicode.
Ie: INSERT INTO table(columnname) VALUES(N'yourstring')
Hope that helps.
精彩评论