我在 SQL Server 2008 中有一个表,其中有一列具有 datatype tinyint。最近我注意到一些非常奇怪的行为。当做类似的事情时
update mytable
set mytinyint = 0
where id = 1
列中的mytinyint值为NULL。下面的查询
update mytable
set mytinyint = NULL
where id = 1
也导致值为NULL。最后这个查询
update mytable
set mytinyint = 1
where id = 1
将值设置为1。
所以我的问题是:为什么不能将值存储在0应该能够存储0and255和之间的任何值的列中NULL?