语句如下:
==========================
select @int_allid=count(sID) from PPOK_House
==========================
[email protected]_SQLWhere
请问如何添加?
注意:
select @int_allid=count(sID) from PPOK_House @str_SQLWhere
这样不行。
------解决方案--------------------
declare @sql nvarchar(1000)
set @sql=N 'select @int_allid=count(sID) from PPOK_House '[email protected]_SQLWhere
exec sp_executesql @sql,N '@int_allid int output ',@int_allid output