SQL Server - SQL Table Basics - Data Types

SQL Server Data Precision
BIT Integer: 0 or 1
TINYINT Positive Integer 0 -> 255
SMALLINT Signed Integer -32,768 -> 32,767
INT Signed Integer -2^31 -> 2^31-1
BIGINT Signed Integer -2^63 -> 2^63-1
REAL Floating precision -1.79E + 308 -> 1.79E + 308
FLOAT Floating precision -3.40E + 38 -> 3.40E + 38
MONEY 4 decimal places, -2^63/10000 -> 2^63-1/10000
SMALLMONEY 4 decimal places, -214,748.3648 -> 214,748.3647
DECIMAL Fixed precision -10^38 + 1 -> 10^38 - 1
NUMERIC Fixed precision -10^38 + 1 -> 10^38 - 1
DATETIME Date+Time 1753-01-01 -> 9999-12-31, accuracy of 3.33 ms
SMALLDATETIME Date+Time 1900-01-01 -> 2079-06-06, accuracy of one minute
CHARn Fixed-length non-Unicode string to 8,000 characters
NCHARn Fixed-length Unicode string to 4,000 characters
VARCHARn Variable-length non-Unicode string to 8,000 characters
NVARCHARn Variable-length Unicode string to 4,000 characters
TEXT Variable-length non-Unicode string to 2,147,483,647 characters
NTEXT Variable-length Unicode string to 1,073,741,823 characters
BINARY Fixed-length binary data up to 8,000 characters
VARBINARY Variable-length binary data up to 8,000 characters
IMAGE Variable-length binary data up to 2,147,483,647 characters 

If you are working in a heterogeneous database environment an environment that employs multiple DBMS vendor solutions you should consider using data types that are common to different vendors in your design.

 


If you find this site useful and are a book buyer/reader...

You can support my site by clicking on one of the Links below to Abe books

By doing this, I will receive a small commision on your purchase and making your purchase will not cost you any more money than if you went directly the site yourself! 

Abe Books sells books at a fraction of the original cost. I have purchased many books from them originally cost $40.00 for as little as $5 to $10 dollars including shipping costs


Click on applicable icon to find books at Abe Books on ...

SQL Server 2008 SQL Server 2005 SQL Server 2000 T-SQL

Abe Books is one of my affiliates. I only use affiliates that I also purchase products from. I love Abe books. If it is printed they likely have a copy. I have also included a generic link to Abe Books below.

Once on their site, you will find that they have a nice, easy to use search engine so to find what you are looking for.

Free Shipping 125x125

SQL Server Examples

SQL DML

String Functions

Transactions

Stored Procedures

SQL Views

SQL Table Basics













navTango.com free

75% of your donation

goes to charity.