传入的是@A,@b参数可以写成这样的存储过程select *
from 表
where (表.字段a=@A or @A is null )
and (表.字段b=@B or @B is null)
不需要写成2的N次方的存储过程的
from 表
where (表.字段a=@A or @A is null )
and (表.字段b=@B or @B is null)
不需要写成2的N次方的存储过程的
调试欢乐多
而且有很多的数据验证组件,比如.net下的验证控件,或是web page里用的很多js类的脚本(当然,不能光用js检测,可能会绕过检测直接post,还是需要服务器代码检测)
from 表
where (表.字段a=@A or @A is null )
and (表.字段b=@B or @B is null)