Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

    ([id], [data], [author], [created], [language], [type_name], [position]) 
    ('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 ?

share|improve this question
up vote 3 down vote accepted

Is this database only supposed to contain greek text? In that case make sure that its collation is one of the greek collations and change the collation of all existing varchar columns.

If you need to be international then use nvarchar columns instead of varchar.

I'm guessing the data column is an xml column? That's also going to be fine.

If you're going with nvarchar or xml then alter the insert statements to insert nvarchar data by putting an N before the string constants, like this

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.