Re: No. of datatypes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/12/04


Date: Mon, 12 Jul 2004 18:50:28 +0530

Hi,

The best place to get all the data type will be SQl serevr Books online.

Info from books online:-
Integers
bigint

Integer (whole number) data from -2^63 (-9223372036854775808) through 2^63-1
(9223372036854775807).

int

Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1
(2,147,483,647).

smallint

Integer data from 2^15 (-32,768) through 2^15 - 1 (32,767).

tinyint

Integer data from 0 through 255.

bit
bit

Integer data with either a 1 or 0 value.

decimal and numeric
decimal

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

numeric

Functionally equivalent to decimal.

money and smallmoney
money

Monetary data values from -2^63 (-922,337,203,685,477.5808) through 2^63 - 1
(+922,337,203,685,477.5807), with accuracy to a ten-thousandth of a monetary
unit.

smallmoney

Monetary data values from -214,748.3648 through +214,748.3647, with accuracy
to a ten-thousandth of a monetary unit.

Approximate Numerics
float

Floating precision number data from -1.79E + 308 through 1.79E + 308.

real

Floating precision number data from -3.40E + 38 through 3.40E + 38.

datetime and smalldatetime
datetime

Date and time data from January 1, 1753, through December 31, 9999, with an
accuracy of three-hundredths of a second, or 3.33 milliseconds.

smalldatetime

Date and time data from January 1, 1900, through June 6, 2079, with an
accuracy of one minute.

Character Strings
char

Fixed-length non-Unicode character data with a maximum length of 8,000
characters.

varchar

Variable-length non-Unicode data with a maximum of 8,000 characters.

text

Variable-length non-Unicode data with a maximum length of 2^31 - 1
(2,147,483,647) characters.

Unicode Character Strings
nchar

Fixed-length Unicode data with a maximum length of 4,000 characters.

nvarchar

Variable-length Unicode data with a maximum length of 4,000 characters.
sysname is a system-supplied user-defined data type that is functionally
equivalent to nvarchar(128) and is used to reference database object names.

ntext

Variable-length Unicode data with a maximum length of 2^30 - 1
(1,073,741,823) characters.

Binary Strings
binary

Fixed-length binary data with a maximum length of 8,000 bytes.

varbinary

Variable-length binary data with a maximum length of 8,000 bytes.

image

Variable-length binary data with a maximum length of 2^31 - 1
(2,147,483,647) bytes.

Other Data Types
cursor

A reference to a cursor.

sql_variant

A data type that stores values of various SQL Server-supported data types,
except text, ntext, timestamp, and sql_variant.

table

A special data type used to store a result set for later processing .

timestamp

A database-wide unique number that gets updated every time a row gets
updated.

uniqueidentifier

A globally unique identifier (GUID).

Thanks

Hari

MCDBA

"Panks" <agarwalp@eeism.com> wrote in message
news:e7FCsQBaEHA.1644@tk2msftngp13.phx.gbl...
> Can anyone tell me how many Data types are there in sql
>
> Thanks
>
>



Relevant Pages

  • Re: Reading GIF
    ... around that lets the programmer deal with a data type that Fortran ... signed integers than as characters. ... In theory, a compiler might not ... support 8-bit signed integers either, ...
    (comp.lang.fortran)
  • Re: Parameter query not working correct.
    ... If Text, be aware that the matching may be affected by invisible formatting characters, such as spaces, embedded carriage returns, or null characters. ... If you are still stuck after that, post the SQL statement, indicate the data type and size of these 2 fields, and the specific values that fail. ... pull along with the loan number and load ID. ...
    (microsoft.public.access.queries)
  • Re: How much space does the long character data type use.
    ... > than 11 characters in the EMPLID field. ... >>Look inside your SQL Server files with SQL File Explorer. ... How does this data type utilize disk space? ...
    (microsoft.public.sqlserver.server)
  • Re: Removing the character limit of text boxes
    ... The Data Type of all the referred columns in my Database table is Memo, ... the three large text boxes must display up to approximately 500 ... boxes are limiting the number of characters they display, ...
    (microsoft.public.access.formscoding)
  • Prothon should not borrow Python strings!
    ... "Strings are a powerful data type in Prothon. ... Characters are logical objects that have ... end is DO NOT ALLOW BINARY DATA IN STRINGS. ... Have a character string type. ...
    (comp.lang.python)