« »

Tipe Data dalam SQL Server


Tipe data dalam SQL Server


Type Of Data
Base Databyte
Synonyms
Range/Domain
Storage Size
Integer
Int
Integer
Whole Numbers from –2,147
,483,648 to
2,147,483,648
4 Bytes
Smallint

Whole numbers from –32,768
32,768
2 Bytes
Tinyint

Whole number from 0 -255
1 byte
Bit

0 or 1

Packet decimal
(exact numeric)
Decimal (p,s)
Dec numeric
Whole or fractional
numbers from -
1038 to 1038
2 – 7 bytes
Floating point
(approx numeric)
Float (15 digit precision)
Float(n), where n is between  8
and 15  double
precision

8 Bytes
Real ( 7 digit precision)
Float(n) where n is between 1-7

4 Bytes
Character
(fixed length)
Char(n)
Character (n)

1 bit per character
declared, even if
partially unused
Character
(variable length)
Varchar(n)
Character varying(n), char
varying(n)

1 bit per character stored
declared but unused
character, do not cunsume
storage
Unicode character string
Nchar(n)
National
Character(n)

2 bytes per character
declared




Nvarchar(n)
National characte
varifying (n)

2 bytes per character
declared but
unused for do not use consumed storage
Ntext
National text

See text description
monetary
Money


8 bytes

Smallmoney


4 bytes
Date and time
datetime

Combine date and time representation
(no separate
char)
8 bytes
Smalldatetime


4 bytes
Binary
(flued length)
Binary(n)

Any binary represatation up
to 255 bytes
n bytes, even partially not
used
Binary
(variable length)
Varbinary(n)

Any binary represatation up
to 255 bytes
n bytes, even partially not
used but unused
for do not use consumed storage
Long text
Text and image


If not null 16 bytes pointer is
used for data
storage
numeric
Cursor

Reference to a cursor, can be
use for variable only

Timestamp

A database wide unique number
8 bytes
Uniqueidentifier

A globaly unique number
16 bytes


Tidak ada komentar:

Posting Komentar

Jumlah View Saat Ini

Popular Posts