日期:2014-05-17 浏览次数:20605 次
declare @sql_com nchar(100)
declare @sql_where nchar(70)
declare @jsbm nchar(3)
set @jsbm='aa'
set @sql_com='select * from tb1 where 1=1 '
set @sql_where =''
select @jsbm as '传回参数'
if (@jsbm = '')
begin
set @sql_where='无字符'
end
else
begin
set @sql_where=@sql_where +' and jsbm = @jsbm '
end
set @sql_com=@sql_com + @sql_where
select @sql_where as '过滤条件'
select @sql_com as '命令部份'
DECLARE @sql_com NCHAR(100)
DECLARE @sql_where NCHAR(70)
DECLARE @jsbm NCHAR(3)
SET @jsbm = 'aa'
SET @sql_com = 'select * from tb1 where 1=1 '
SET @sql_where = ''
SELECT @jsbm AS '传回参数'
IF ( @jsbm = '' )
BEGIN
SET @sql_where = '无字符'
END
ELSE
BEGIN
SET @sql_where = @sql_where + ' and jsbm = '+ @jsbm
END
SET @sql_com = @sql_com + @sql_where
SELECT @sql_where AS '过滤条件'
SELECT @sql_com AS '命令部份'