Difference between Char and Varchar datatypes | SQL Server

Published: 04 August 2021
on channel: DataGuru Naval
4,720
58

For database related videos, please subscribe channel
   / @datagurunaval  

CHAR Vs VARCHAR

While declaring a variable without specifying the argument “n”, the default length is 1.

Similarities between CHAR vs. VARCHAR in SQL

1) Both stores non-Unicode characters.
2) Both are character data types.
3) Both take 1 byte to store one character.
4) It can hold numbers, letters and special characters.

5) The maximum length of both CHAR and VARCHAR data types is 8000 characters in SQL Server. Maximum length is defined in parenthesis, e.g. maximum length of CHAR(6) is 6 characters, and the maximum length of VARCHAR(6) is also 6 characters.
6) Index can be created on both the data types.


On this page of the site you can watch the video online Difference between Char and Varchar datatypes | SQL Server with a duration of hours minute second in good quality, which was uploaded by the user DataGuru Naval 04 August 2021, share the link with friends and acquaintances, this video has already been watched 4,720 times on youtube and it was liked by 58 viewers. Enjoy your viewing!