我正在查看存储过程并看到许多行,例如:
case when len(isnull(INVOICE.INVOICE_DATE,'')) > 0
and isdate(INVOICE.INVOICE_DATE) = 1
then convert(datetime,INVOICE.INVOICE_DATE)
else null end
和
case when len(isnull(SHIPMENT.NET_AMOUNT_DUE,'')) > 0
and isnumeric(SHIPMENT.NET_AMOUNT_DUE) = 1
then convert(money,SHIPMENT.NET_AMOUNT_DUE)
else null end
我不明白为什么ISNULL
和LEN
检查总是在那里。我缺少一些好处吗?相反,代码当前的编写方式是否有任何损害?