昨天在我们的一个程序发现了一个Bug, 程序是给Accounting用的一个Report,但是Accounting的人发现无论如何这个Report抓不出数据,跟进去查了一下,发现查数据的Sql是类似这样的:

   Select * from table_1 where sonumber not in

(select sonumber from table_2

union all

select sonumber from table_3

)

数据在Table_1里是存在的,table_2/3 里也不包含对应的SOnumber,但是Query的结果就是没有数据。再查了一下,发现原因在于Table_2中有些SoNumber的值是Null,而 where [field] not in (null) 这个判断,在Sql 里总是会返回false的 (偶这里的SET ANSI_NULLS 是ON,不过好像偶没见谁用过OFF)

改了一下in里的Select,处理掉NULL值以后Bug Fix

-------------------------------

 潜水N久,俺又回来了。 最近会玩弄一些Biztalk 和 SAP R3互联方面的东西,今天这个算一小泡泡。