Hi All in my second post on i am going to describe Data Types available in sqlserver 2005
In SQL Server, each column, local variable, expression, and parameter has a related data type. A data type is an attribute that specifies the type of data that the object can hold: integer data, character data, monetary data, date and time data, binary strings, and so on.
INTEGER VALUES:
tinyint storage capacity 1 byte
smallint storage capacity 2 byte
int storage capacity 4 byte
bigint storage capacity 8 byte
FLOAT VALUES:
Decimal(p,s)
where p is precision and s is scale.precision tells the otal number of digit in the value. storage value varies according to p value like
if p is 1 - 9 then storage will be 5 byte
if p is 10-19 then storage will be 9 byte
if p is 20-28 then storage will be 13 byte
if p is 29-38 then storage will be 17 byte
The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The default precision is 18.
The maximum number of decimal digits that can be stored to the right of the decimal point. Scale must be a value from 0 through p. Scale can be specified only if precision is specified. The default scale is 0; therefore, 0 <= s <= p. Maximum storage sizes vary, based on the precision.
CURRENCY VALUES:
smallmoney storage 4 byte
money storage 8 byte
these are used for storing currency values
BOOLEAN VALUES:
bit
Are character data types of either fixed length or variable length.
In SQL Server, each column, local variable, expression, and parameter has a related data type. A data type is an attribute that specifies the type of data that the object can hold: integer data, character data, monetary data, date and time data, binary strings, and so on.
INTEGER VALUES:
tinyint storage capacity 1 byte
smallint storage capacity 2 byte
int storage capacity 4 byte
bigint storage capacity 8 byte
FLOAT VALUES:
Decimal(p,s)
where p is precision and s is scale.precision tells the otal number of digit in the value. storage value varies according to p value like
if p is 1 - 9 then storage will be 5 byte
if p is 10-19 then storage will be 9 byte
if p is 20-28 then storage will be 13 byte
if p is 29-38 then storage will be 17 byte
The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The default precision is 18.
The maximum number of decimal digits that can be stored to the right of the decimal point. Scale must be a value from 0 through p. Scale can be specified only if precision is specified. The default scale is 0; therefore, 0 <= s <= p. Maximum storage sizes vary, based on the precision.
CURRENCY VALUES:
smallmoney storage 4 byte
money storage 8 byte
these are used for storing currency values
BOOLEAN VALUES:
bit
The SQL Server Database Engine optimizes storage of bit columns. If there are 8 or less bit columns in a table, the columns are stored as 1 byte. If there are from 9 up to 16 bit columns, the columns are stored as 2 bytes, and so on.
The string values TRUE and FALSE can be converted to bit values: TRUE is converted to 1 and FALSE is converted to 0.
CHARACTER VALUES:
No comments:
Post a Comment