Sei sulla pagina 1di 3

Data Type

From

To
9,223,372,036,854, 775,807 2,147,483,647 32767 255 1 -1038 -1 8

Bytes

EXACT NUMERICS Bigint 9,223,372,036,854,7 75,808 Int -2,147,483,648 Smallint -32768 Tinyint 0 Bit 0 Decimal -1038 +1

-1038 +1 -1038 -1 922,337,203,685,47 922,337,203,685,47 7.5808 7.5807 Smallmoney -214,748.3648 +214,748.3647 4 numeric and decimal are Fixed precision and scale data types and are functionally equivalent. APPROXIMATE NUMERICS Float -1.79E + 308 -1.79E + 308 4 bytes if P is 1 24 8 bytes if P is 25 - 53 Real -3.40E + 38 3.40E + 38 4 DATE AND TIME Date Jan 1st 0001 Dec 31st 9999 3 [New 2008] st st DateTime Jan 1 1753 / Dec 31 9999 / 8 00:00:00 23:59:59.997 DateTime2 Jan 1st 0001 / Dec 31st 9999 / 6 8 [New 2008] 00:00:00 23:59:59.997 SmallDateTim Jan 1st 1900 / June 6th 2079 / 4 e 00:00:00 23:59:59 Time 00:00:00.0000000 23:59:59.9999999 5 [New 2008] st st DateTimeOffse Jan 1 0001 / Dec 31 9999 / 10 [New 2008] t 00:00:00 23:59:59 Defines a date that is combined with a time of a day that has time zone awareness and is based on a 24-hour clock. CHARACTER STRINGS (each char occupies 1 byte) Char Fixed Length Non-Unicode Char Data With a Maximum of 8000 characters Varchar Variable Length Non-Unicode Data With a Maximum of 8000 characters Varchar(max) Variable Length Non-Unicode Data With a Maximum of 231 characters [New 2005] Text Variable Length Non-Unicode Data With a Maximum of 2,147,483,647 characters Numeric Money

4 2 1 1 5 to 17 1-9 5 bytes 10-19 9 bytes 20-28 13 bytes 29-38 17 bytes Same As Decimal 8

UNICODE CHARACTER STRINGS (each char occupies 2 bytes) Nchar Fixed-length Unicode data with a maximum of 4,000 characters Nvarchar Variable-length Unicode data with a maximum of 4,000 characters Nvarchar(max) Variable-length Unicode data with a maximum of 230 characters [New 2005] Ntext Variable-length Unicode data with a maximum of 1,073,741,823 characters BINARY STRINGS Binary Fixed-length binary data with a maximum of 8,000 bytes Varbinary Variable-length binary data with a maximum of 8,000 bytes Varbinary(max Variable-length binary data with a maximum of 231 bytes ) [New 2005] Image Variable-length binary data with a maximum of 2,147,483,647 bytes OTHER DATA TYPES SQL_Variant Stores values of various SQL Server-supported data types, except text, ntext, and timestamp. Timestamp Stores a database-wide unique number that gets updated every time a row gets updated. Uniqueidentifie Stores a globally unique identifier (GUID). r Xml Stores XML data. You can store xml instances in a column or a variable Cursor A reference to a cursor. Table Stores a result set for later processing. Hierarchyid The hierarchyid data type is a variable length, system data type. Use hierarchyid to represent position in a hierarchy. A column of type hierarchyid does not automatically represent a tree. It is up to the application to generate and assign hierarchyid values in such a way that the desired relationship between rows is reflected in the values. Geometry The geometry data type (planar) supported by SQL Server conforms to the Open Geospatial Consortium (OGC) Geography The geography spatial data type, geography, is implemented as a .NET common language runtime (CLR) data type in SQL Server. This type represents data in a round-earth coordinate system. The SQL Server geography data type stores ellipsoidal (round-earth) data, such as GPS latitude and longitude coordinates. FileStream FILESTREAM integrates the SQL Server Database Engine with an NTFS file system by storing varbinary(max) binary large object (BLOB) data as files on the file system.

Potrebbero piacerti anche