unicode for database - best for overall performance?

Posted on 2013-10-18
Medium Priority
Last Modified: 2013-11-04
i read in the below:

"ll modern operating systems and development platforms use Unicode internally. By using nvarchar rather than varchar, you can avoid doing encoding conversions every time you read from or write to the database. Conversions take time, and are prone to errors. And recovery from conversion errors is a non-trivial problem.

If you are interfacing with an application that uses only ASCII, I would still recommend using Unicode in the database. The OS and database collation algorithms will work better with Unicode. Unicode avoids conversion problems when interfacing with other systems. And you will be preparing for the future. And you can always validate that your data is restricted to 7-bit ASCII for whatever legacy system you're having to maintain, even while enjoying some of the benefits of full Unicode storage.

Can you qualify that if it is safe to allow nvarchar even when unicode is not used in the application, but may be better for overall system?

Question by:25112
1 Comment
LVL 40

Accepted Solution

lcohan earned 2000 total points
ID: 39583604
I would definitely NOT recommend to use N-char/varchar/text if not needed. For instance SQL may not use an index even if exists and matching the WHERE clauses IF you miss the N in front of a string to search and that could be serious performance issue that can be fixed ONLY by adding that little missing N in front of all strings in a where clause. Speciffic - I work with a 3rd party product where we had this EXACT issue and when we proved it to the vendor...they'll have a lots of changes to make just because they used N for all text like fields in the database - just in case to be safe if anyone puts a UNICODE char. well...is their app and they should not allow it to happen.

Anyway you could do a quick test based on my comments to prove it for yourself.

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this article, we will show how to detach and attach a database and then show how to repair a corrupt database and attach it, If it has some errors. We will show how to detach and attach using SSMS or using T-SQL sentences.
An introductory discussion about Oracle Analytic Functions which are used to calculate or compute Aggregate values, based on a group of rows.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

586 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