
SQL Server data types
The SQL Server Database Engine utilizes a wide selection of data types. A data type is a definition of how a value is structured, stored, and handled. There are data types for any kind of structured, semi-structured, and non-structured type of data.
Structured data types are native SQL Server data types such as int, char, varchar, datetime, binary, varbinary, money, decimal, geography, geometry, location, and so on. Character-based data types support both non-unicode, char/varchar, and unicode, nchar/nvarchar.
Semi-structured data types, such as xml, store their data in a structured manner internally and is usually handled by the database engine as large objects, but at the same time offers flexibility to add custom functions and indexes to efficiently display its content.
Non-structured data types are usually referred to as large objects called blob (binary large objects) or clob (character large objects) and used to store large amounts of data such as documents and binaries in the database. Also, varbinary(max), varchar(max), and nvarchar (max) are seen as non-structured objects. From the 2016 version , SQL Server had used a more modern approach and adequate data types for dealing with non-structured data: polybase feature and support for JSON.
Every data type offers specific features for a specific use. When designing a database, it's important to choose the right data type for every column of a table.