搜索sql语句
时间:2020-10-31 14:15 作者:admin610456
CREATEproceduredbo.select_a
@bvarchar(50),
@cvarchar(50),
@dvarchar(50),
@evarchar(50)
as
declare@strsqlvarchar(5000);
set@strsql='select*fromawhere1=1';
if@b<>''
set@strsql=@strsql+'andb="'+@b+'"';
if@c<>''
set@strsql=@strsql+'andc="'+@c+'"';
if@d<>''
set@strsql=@strsql+'andd="'+@d+'"';
if@e<>''
set@strsql=@strsql+'ande="'+@e+'"';
exec(@strsql)
GO
(责任编辑:admin)