nvarchar or varchar. Need suggestion

  • Hi,

     I have a colum with data type varchar(200). I need to store string that can be 3, 10, 100 etc. So should I use varchar or nvarchar datatype?

     I want to save space so i have read somewhere that varchar is intelligent datatype and will use space depending on string on the other hand nvarchar will use fixed space alloted to datatype. Is that correct and plz little explanation why I use one of the datatype? Some technicial insite

     Thanks

  • Both varchar and nvarchar are variable length, meaning they use space according to what's stored.

    The difference is nvarchar can store unicode data.

    You can read more in Books Online.

     

  • thanks for the reply

    that means if my variable is of 5 characters than varchar(200) will occupy space of 5 characters right? not what is defined in datatype.

  • you are correct (n)varchar is variable length while (n)char is fixed length

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply