Data Types

As stated on MSDN, a data type is an attribute that specifies the type of data that the object can hold. Choosing an appropriate data type is one of the most important decisions that you will make when designing your database. Your decision can have a positive or negative impact on your database's performance and storage requirements.

If the data type is too restrictive it can cause an issue like restricting the growth of your database. For example using the 'tiny int' data type which has a maximum value of 255 instead of using the 'int' data type which has a maximum value of 2,147,483,647. If you choose a data type that is broad and allows anything to be stored then you may end up using excess server resources such as disk space and memory which will result in performance issues.

SQL Server 2005 and 2008 native data types are organized into seven categories: Exact numerics, Approximate numerics, Date and Time, Character strings, Unicode character strings, Binary strings and other data types (also called Special purpose). Some books include Unicode character strings as part of Character strings category and highlights Monetary as the 7th category. Check MSDN: Data Types for more detailed information about the categories and their data types, including storage details and restrictions. Ensure that you avoid using data types that are being deprecated to avoid future upgrade issues.


Community Links