Search code examples
sql-serversql-server-2005storagevarcharnvarchar

What are the main performance differences between varchar and nvarchar SQL Server data types?


I'm working on a database for a small web app at my school using SQL Server 2005.
I see a couple of schools of thought on the issue of varchar vs nvarchar:

  1. Use varchar unless you deal with a lot of internationalized data, then use nvarchar.
  2. Just use nvarchar for everything.

I'm beginning to see the merits of view 2. I know that nvarchar does take up twice as much space, but that isn't necessarily a huge deal since this is only going to store data for a few hundred students. To me it seems like it would be easiest not to worry about it and just allow everything to use nvarchar. Or is there something I'm missing?


Solution

  • Always use nvarchar.

    You may never need the double-byte characters for most applications. However, if you need to support double-byte languages and you only have single-byte support in your database schema it's really expensive to go back and modify throughout your application.

    The cost of migrating one application from varchar to nvarchar will be much more than the little bit of extra disk space you'll use in most applications.