TINYINT (TSQL Datatype)
Is a one-byte unsigned integer.
Syntax
TINYINT
Range
0 to 255
Literal Tinyint
There is no syntax for writing a literal
tinyint
.
You just use a literal int
, and it will be converted to tinyint
.
DECLARE @a TINYINT;
SET @a = 123; -- 123 is a literal 'int'
Examples
DECLARE @a TINYINT = 123;
PRINT @a * 100000; -- result is 'int', because 'tinyint' * 'int' --> 'int'
The result is:
12300000