vachar vs nvachar in SQL Server

Do you know- 

  • VARCHAR takes less amount of disk space to store than NVACHAR for the same string.
  • VARCHAR does not support unicode data. So, if I try to save a string that is in any other language than English, it fails to display it as is.
  • Thus NVARCHAR comes to our rescue in case we want to save unicode string variables/ literals.
  • If we run the execution plan for select statements that have VARCHAR and NVARCHAR, we will notice that NVARCHAR takes more time to than VARCHAR.

remember these simple things and design your database variables next time to save disk and save execution to be faster.
Happy coding.


Post a Comment