Promotic

Data types in MsSQL Server

Data type Length Description
bigint 8 Integer from -2^63 (-9 223 372 036 854 775 808) to 2^63-1 (9 223 372 036 854 775 807)
int 4 Integer from -2^31 (-2 147 483 648) to 2^31-1 (2 147 483 647)
smallint 2 Integer from -2^15 (-32 768) to 2^15-1 (32 767)
tinyint 1 Integer from 0 to 255
bit 1 bit Integer 0 or 1.
decimal(precision, scale) 5-17 Numeric data type with fixed precision and scale (precision 1-38, 18 by default and scale 0-p, 0 by default).
numeric 5-17 The same as decimal data type.
money 8 Financial data type from -2^63 (-922 337 203 685 477.5808) to 2^63-1 (922 337 203 685 477.5807) with the precision of one ten-thousandth unit.
smallmoney 4 Financial data type from -2^31 (-214 748.3648) to 2^31-1 (214 748.3647) with the precision of one ten-thousandth unit.
float(n) 4-8 Numeric data type with float precision, where n is the number of mantis bits (1-24, precision of 7 digits, size of 4 bytes and 25-53, precision of 15 digits and size of 8 bytes).
real 4 Numeric data type with float precision that is defined as a float(24).
datetime 8 Data type representing date and time from 1.1.1753 to 31.12.9999 with the precision about 3 ms. Values are rounded to .000, .003 and .007.
smalldatetime 4 Data type representing date and time from 1.1.1900 to 6.6.2079 with the precision of 1 minute. Values up to 29.998 are rounded down and values from 29.999 are rounded up to the nearest minute.
char n Text string of fixed length (maximum length: 8000 characters)
varchar n Text string of variable length (maximum length: 8000 characters)
text n Text string of variable length (maximum length: 2^31-1 = 2 147 483 647 characters)
nchar 2*n Unicode text string of fixed length (maximum length: 4000 characters)
nvarchar 2*n Unicode text string of variable length (maximum length: 4000 characters)
ntext 2*n Unicode text string of variable length (maximum length: 2^30-1 = 1 073 741 823 characters)
binary n+4 Binary data of fixed length (maximum length: 8000 bytes)
varbinary n+4 Binary data of variable length (maximum length: 8000 bytes)
image n Binary data of variable length (maximum length: 2^31-1 = 2 147 483 647 bytes)
cursor   For storing the reference to cursors in the variable or in a procedure (no in the CREATE TABLE method).
sql_variant   For storing value of another type (no text, ntext, image, timestamp, sql_variant) of max. length to 8016 bytes. ODBC doesn't fully support this data type.
table   For storing the query result for the later usage.
timestamp 8+4 Data type generates automatically binary numbers, unique in the database, used usually to the rows identification. There can be only column of this data type in the table.
uniqueidentifier   Data type for storing GUID (new by means of the NEWID function or existing from the string in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, for example 6F9619FF-8B86-D011-B42D-00C04FC964FF).
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.