CREATE procedure dbo.select_a
@b varchar(50),
@c varchar(50),
@d varchar(50),
@e varchar(50)
as
declare @strsql varchar(5000) ;
set @strsql='select * from a where 1=1 ';
if @b <>''
set @strsql= @strsql+' and b="'+@b +'"';
if @c <>''
set @strsql= @strsql+' and c="'+@c +'"';
if @d <>''
set @strsql= @strsql+' and d="'+@d +'"';
if @e <>''
set @strsql= @strsql+' and e="'+@e +'"';
exec (@strsql)
GO
最后
以上就是会撒娇酸奶最近收集整理的关于搜索sql语句的全部内容,更多相关搜索sql语句内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复