Intel allocation for bits in SQL Server

What happens if I add INT to BIT when the INT value is 0 and the INT value is different from 0?

Like:

 SELECT CAST (0 AS bit) 

or

 SELECT CAST (10 AS bit) 
+1
sql-server
source share
1 answer

Just try:

 SELECT CAST (10 AS bit) AS a, CAST (0 AS bit) AS b 

returns:

 a | b ==+== 1 | 0 

This means that 0 remains unchanged, while all other integer values ​​are converted to 1.

+7
source share

All Articles