What is the difference between char and varchar in SQL Server?

char is a fixed-length character data type. It stores a specified number of characters, padding with spaces if the value is shorter than the specified length.

varchar is a variable-length character data type. It stores a variable number of characters, up to the specified maximum length.

Leave a Reply

Your email address will not be published. Required fields are marked *