VarChar is used to hold a string of characters. It is a variable length string. The maximum length is 8000 characters.
example of creating a table with a VarChar column:
1 | CREATE TABLE dbo.MyTable ( |
In this case we created a table with two columns. The first column is a VarChar column with a maximum length of 50 characters. The second column is a VarChar column with a maximum length of 50 characters.
populate string related functions
Substring
SUBSTRING ( expression, start, length )
Start is 1 based