Datatypes define the type of data that can be stored in tables. When each column is defined, it is assigned a datatype, which enforces basic integrity by limiting the type and size of the data that can be entered. Choosing the correct datatype for each column is crucial to efficient data storage, performance, and application compliance.
SQL Server provides several base datatypes, which are grouped by the type of data that they store. Table 12.2 shows the system-supplied datatypes and their storage capacities.
|Data Type Category||SQL Server Data Type||Number of Bytes|
char[(n)] varchar[(n)] text
nchar[(n)] nvarchar[(n)] ntext
(4000 characters)0–2GB ...