您现在的位置是:网站首页> 编程资料编程资料
搜索sql语句_MsSql_
2023-05-26
396人已围观
简介 搜索sql语句_MsSql_
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
@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
