Duration: 17:58 min
Summary: In this video, we will wrap up our data type discussion. Working with characters is very important to us. So, we need to make sure we are able to declare variables with character data types. We have two options: (1) Fixed-length string data, and (2) variable-length string data. In the case of fixed-length, as the name implies, we are declaring using the same length consistently. For example, we know that the state abbreviation is 2. So we can declare a variable of type char(2). But in most cases, we know that we do not have control over the length of the data. For that we use ‘varchar’. If we do not specify the length (as in ‘declare x as char), the default is 1 character. In our discussion, we will talk about the difference between char/varchar and nchar/nvarchar. Finally, we will see how to declare variables of type ‘uniqueidentifier’, and how sql server supports the xml data type.