This is a mirror of official site: http://jasper-net.blogspot.com/

Avoid using varchar or char data type

| Sunday, April 10, 2011
Today,  I like to put one suggestion for choosing the data type of string column.  My recommendation is always go with nvarchar type. You will not be regret if your database always using nvarchar type.  For example, our SharePoint backend database always use nvarchar type, and they don't have any issue related to store characters in different language.  And the nvarchar types has better support in .Net, ODBC, JDBC, and Windows. 

  Varchar or Char types can only support a very limited range of characters, and the client or tools support is not so great comparing with nvarchar type.

It is true that using nvarchar type will double the data size if most of your data is Latin character.  in SQL Server 2008 R2, our Data Compression Feature's page compression option allow you to compress such database to more than half of the size with less performance impact.  So I suggest that you using nvarchar type with page compression together to achieve both small disk size and better platform support.   Our SharePoint database use exactly the same technique.

Posted via email from Jasper-net

0 comments: