II.3.1. Traditional Data Types

If you have any experience with relational databases, you probably already know and love this first batch of data types. Many of them have been used to store information for decades, and more than 2 dozen are now at your disposal. To help you understand these types better, it's a good idea to group them into several major classifications, which is what we show you in this section.

Before we get started, first look at how you can get a full picture of all the data types at your disposal. Again, we turn to the trusty SQL Server Management Studio to help.

  1. Launch the SQL Server Management Studio.

  2. Connect to the appropriate SQL Server instance.

  3. Expand the connection's entry in the Object Explorer view.

  4. Expand the Databases folder.

  5. Open the folder entry for your database.

  6. Expand the Programmability folder.

  7. Expand the Types folder.

You see a list of all the data types at your disposal. To begin, you can see all the system data types. In other words, these are the data types that ship with SQL Server, organized into the following folders:

  • Exact Numerics

  • Approximate Numerics

  • Date and Time

  • Character Strings

  • Unicode Character Strings

  • Binary Strings

  • Other Data Types

A collection of other folders is here as well. These folders hold information about data types that you, the SQL Server administrator, can define, along with information about XML schema stored in your database.

Figure 3-1 shows how system data types appear in the SQL Server Management Studio.


Each database ...

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.