I tried the following query
DECLARE @Input INT = 300 DECLARE @Ouput TINYINT SET @Ouput = @Input SELECT @Ouput
While executing the above statement, I received the following error.
Arithmetic overflow error for tinyint data type, value = 300.
The input value exceeds the limit, so an error is displayed.
I tried another request
DECLARE @Input INT = 300 DECLARE @Ouput BIT SET @Ouput = @Input SELECT @Ouput
When I execute the statement, I really wondered: it does not show any errors . If the input value is <> 0 (negative or positive), the output value is always 1 .
sql-server int bit
Jesuraja
source share