The SQL Server string is divided into different types, and you will be presented with a few common types of SQL Server strings that you can use to help you learn SQL Server strings.
NChar
This data type can store 1~4000 fixed-length Unicode strings, string lengths are specified at creation time, and default to nchar (1) if unspecified. Each character occupies 2bytes of storage space.
varchar
This data type can store variable long strings with a maximum value of 8,000 characters. The maximum length of a variable-length string is specified at creation time, such as varchar (50), with each character occupying 1byte of storage space.
nvarchar
This data type can store a variable-length Unicode string with a maximum value of 4,000 characters. The maximum length of a variable-length Unicode string is specified at creation time, such as nvarchar (50), with each character occupying 2bytes of storage space.
Text
This data type stores variable-length text with a maximum value of 2,147,483,647 characters, and does not need to specify its initial value, each character occupies 1byte of storage space, and is typically used to store large sections of the article. The text data type is actually a large object data type, by default, this type of data is not stored in the data row, but instead is stored on a separate large object data page. In addition, the text data type cannot be used as a parameter in a function, stored procedure, or trigger.
Types of SQL Server strings