日期:2014-05-17 浏览次数:20460 次
declare @where nvarchar(100)
declare @NotGDChnCount int
declare @sql nvarchar(1000)
set @sql=N'select @Count=COUNT(distinct id) from GoldCardReplacementData
where DataType=1 '
EXEC sp_executesql @sql,N'@Count int output',@NotGDChnCount output
select @NotGDChnCount
print @sql
declare @where nvarchar(100)
declare @NotGDChnCount int
declare @sql nvarchar(1000)
SET @where=' where DataType=1 '
set @sql=N'select @Count=COUNT(distinct id) from GoldCardReplacementData'+@where
EXEC sp_executesql @sql,N'@Count int output',@NotGDChnCount output
select @NotGDChnCount
print @sql
------解决方案--------------------
我就说你都只有定义没有使用....
------解决方案--------------------
恭喜楼主自立更生
------解决方案--------------------
where 里面给成1=1 先给个 让where恒成立
------解决方案--------------------