Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL datatype

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 312
    Comment on it

    SQL data type is an attribute that tell us the type of the object.

    SQL server has 6 type of datatype

    Exact numeric data type

    1. bigint- Range start from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

    2. int- Range start from -2,147,483,648 to 2,147,483,647

    3. smallint- Range start from -32,768 to 32,767

    4. tinyint- Range start from 0 to 255

    5. bit- Range start from 0 to 1

    6. decimal- Range start from -10^38 +1 to 10^38 -1

    7. numeric- Range start from -10^38 +1 to 10^38 -1

    8. money- Range start from -922,337,203,685,477.5808 to 922,337,203,685,477.5807

    9. smallmoney- Range start from -214,748.3648 to 214,748.3647

    Approximate numeric data type

    1. float- Range start from -1.79E + 308 to 1.79E + 307

    2. real- Range start from -3.40E + 38 to 3.40E + 37

    Date and time data type

    1. datetime- Range start from Jan 1, 1753 to Dec 31, 9999

    2. smalldatetime- Range start from Jan 1, 1900 to Jun 6, 2079

    3. date- Stores a date like June 30, 1991

    4. time- Stores a time of day like 12:30 P.M.

    Character string data type

    1. char- Range extend to 8000 character Fixed length non-Unicode characters

    2. varchar- Range extend to 8000 character Fixed length non-Unicode data

    3. varchar(max)- Range extend to 231 character

    4. text- Range extend to 2,147,483,647

    Unicode character string data type

    1. nchar- Fixed length Unicode 4000 character

    2. nvarchar- Variable length Unicode 4000 character

    3. nvarchar(max)- Variable length Unicode 231 character

    4 ntext- Variable length 1,073,741,823 character

    Binary data type

    1. binary- Fixed-length binary data 8000 byte

    2. varbinary- Variable length binary data 8000 byte

    3. varbinary(max)- Variable length Binary data 231 byte

    4. image- Variable length 2,147,483,647 byte

    Misc data type

    1. sql_variant- SQL Server-supported data types

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

    3. uniqueidentifier- globally unique identifier

    4 xml- XML dataSQL Server 2005

    5 cursor- cursor object

    6 table- result set for later processing

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: