[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

SQL Server collation for unicode data

Posted on 2009-02-08
8
Medium Priority
?
1,199 Views
Last Modified: 2012-05-06
What should be the collation for the unicode data
0
Comment
Question by:rajneesh1978
  • 4
  • 3
8 Comments
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 23587877
To Store Unicode Data, there is no need to consider Collation.
You have to store it in NChar/ NVarchar / NText instead of Char/ Varchar / Text columns.

Collations can be anything, It considers the order in which you need to sort your data.
0
 
LVL 37

Expert Comment

by:momi_sabag
ID: 23587887
colloation determines among other things the sort order and acsent definition, so you need to choose the collation you need for your data even though you use unicode
0
 

Author Comment

by:rajneesh1978
ID: 23588458
please help to let me know

1) what are things to keep in mind for making standardize UTF-8(client and server)
2) Any editor which will support to edit ASP pages for UTF-8
3) Things to keep in mind while importing data in backend for UTF-8 database

0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 23588547
Run this query:

SELECT * FROM fn_helpcollations()
WHERE description LIKE '%unicode%'

Choose the Collation of your choice

And this will give you more insight of your other requirements.
0
 

Author Comment

by:rajneesh1978
ID: 23608440
where is the defination for the function fn_helpcollations?
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 23608493
It is a table valued function and returns all types of Collation available in SQL server.
0
 

Author Comment

by:rajneesh1978
ID: 23656868
Please let me know the things to keep in mind while importing data in backend for UTF-8 database
0
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 1500 total points
ID: 23657655
As I mentioned earlier, you can choose any of the collation listed by the query provided earlier to suit your needs:

SELECT * FROM fn_helpcollations()
WHERE description LIKE '%unicode%'

In SQL Server, If you choose Nvarchar / Nchar / Ntext in any of the collations listed above, you can successfully store and retrieve UTF-8 characters.

When importing data, specify the data type as SQLNCHAR instead of SQLCHAR. This will handle your unicode data perfectly
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question