A data type is an attribute that specifies the type of data that the object can hold like integer data, character data, monetary data, date and time data, binary strings and so on.
SQL Server provides a basic data types for each column, local variable, expression and parameter that can hold data, such as numeric, character and dates.
SQL Server uses the following precedence order for data types:
1. user-defined data types (highest) | 11. real | 21. text |
2. sql_variant | 12. decimal | 22. image |
3. xml | 13. money | 23. timestamp |
4. datetimeoffset | 14. smallmoney | 24. uniqueidentifier |
5. datetime2 | 15. bigint | 25. nvarchar (including nvarchar(max) ) |
6. datetime | 16. int | 26. nchar |
7. smalldatetime | 17. smallint | 27. varchar (including varchar(max) ) |
8. date | 18. tinyint | 28. char |
9. time | 19. bit | 29. varbinary (including varbinary(max) ) |
10. float | 20. ntext | 30. binary (lowest) |