Recent Articles

Using DataTables More For Improving Performance
There are some features in the System.Data.DataTable class that a lot of developers don't utilize.

Open Source SQL Full Text Search Engine - Sphinx
CLR or TSQL? That is the question. More are more developers are struggling to find the right answer, but the answer really depends on the developer's individual needs. For classic SQL tasks, the good old TSQL is recommended. On the other hand, CLR works...

CLR Vs T-SQL And Stored Procedures In SQL Server
CLR or TSQL? That is the question. More are more developers are struggling to find the right answer, but the answer really depends on the developer's individual needs. For classic SQL tasks, the good old TSQL is recommended. On the other hand, CLR works best for calculations, parsing, image processing and...

MySQL Gets Telecom-Specific
Due to demand, MySQL AB announced the expansion of its telecom-specific services and consulting for MySQL software. Specifically, the company is promoting its MySQL Cluster, a high-end version of the standard database designed for fault-tolerant...

Practice Makes Perfect For SQL
MySQL guru Sheeri Kritzer listed eight SQL best practices for database professionals who are hard at work on their projects. Kritzer's list began with a preface on why she tries to live by the eight SQL rules in her post about...

Ingres Christens Project Icebreaker
The open source database company Ingres teamed with another open source player to deliver Icebreaker, a way to place database services on a server with no operating system required. Ingres CTO Dave Dargo blogged about Icebreaker, which launched recently during...

MySQL Turbo Manager And Dream Coder
The success and the longevity of any prominent business nowadays depend on powerful application infrastructures and effective, reliable management and development solutions. In present, a wide range of IT companies...


Low Rate eCommerce & Retail Plans
12.05.06


SQL Server 2000 Data Types

By Chris Kemp

SQL Server requires that each variable and column in a table should be defined with respect to the type of data it will store.

From a bit to a huge image and binary storage types, the allocation is supposed to help the user conform to the data required, and help the engine allocate space and processing speed efficiently.

Built-in data types

SQL Server 2000 recognizes the following built in data types:

Data Types
Description

bigint
Integer data from -2^63 through 2^63-1

int
Integer data from -2^31 through 2^31 - 1

smallint
Integer data from -2^15 through 2^15 - 1

tinyint
Integer data from 0 through 255

bit
Integer data with either a 1 or 0 value

decimal
Fixed precision and scale numeric data from -10^38 +1 through 10^38 -1

numeric
Fixed precision and scale numeric data from -10^38 +1 through 10^38 -1

Click here for a complete list...

Low Rate eCommerce & Retail Plans

How to choose the appropriate data type

SQL Server stores data in data pages that are 8Kb (8192 bytes) in size. The system uses some of that s Sometimes, the system uses only 8060 bytes are availableto that are available to store user's data. Consider the size of a row of data in your tables. If the rows are large, make sure that multiples of the fit conveniently on a data page so that page space is not wasted. This is cut down on disk paging overhead when accessing the data. You want to maximize the number of rows of data which that will fit on a page. This can be accomplished both by splitting the tables, and by choosing the smallest data type which that will accommodate your data. .

In you are using integer data, data; consider that the tinyint datatype will accommodate data which that will fit into one byte of storage. So if the range of all of the data in your field (or variable) is between 0 and 255, use the tinyint datatype. If the range is between -32,768 and 32,767, use the smallint data type. And if If you need to store integer data from -2,147,483,648 through 2,147,483,647, use int data type.

Similarly with smallmoney. If smallmoney. if your value range is between -214748.3648 and 214,748.3647, use the smallmoney datatype.

Use smalldatetime data type instead of datetime data type, if you need to store the date and time data from January 1, 1900 through June 6, 2079, with accuracy to the minute.

Prefer varchar.nvarchar to text/ntext whenever possible because the text and image fields are stored separately, which produces additional paging. And prefer char/varchar to nchar/nvarchar data types because the n types require twice as much storage space. The n types are used primarily for unicode data.

Resources

• Tutorial: SQL 7 & Database Files
This is a useful tutorial on SQL & and database Files.

• Information: Complete information on SQL
This resource provides complete information on SQL.


About the Author:
Metro NY / NJ SQL Server Consultants
We specialize is custom database software. Call (973) 635 0080 or email us at paladn.com

Chris Kemp is a well known author in the field of Information Technology. His articles are very popular and well known in the various article banks across internet. His popular articles are about SQL Server, Database Design, IT Consulting and Software Development.

chriskemp@webpopularity.org

About SQLproNews
SQLproNews is a collection of up to date tutorials and insightful articles designed to help SQL users of any skill level implement successful SQL systems and practices. SQL Strategies and Tactics for Business

SQLproNews is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
SQLproNews.com WirelessProNews.com
CProgrammingTrends.com SysAdminNews.com




-- SQLProNews is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2006 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

advertising info | news headlines | free newsletters | comments/feedback | submit article


SQL Strategies and Tactics for Business SQLproNews News Archives About Us Feedback SQLproNews Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact