首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

50分问个初学者有关问题!比较急多谢了

2012-01-18 
50分问个菜鸟问题!!!比较急。谢谢了。 语句如下:select@int_allidcount(sID)fro

50分问个菜鸟问题!!!比较急。谢谢了。

语句如下:
==========================
select   @int_allid=count(sID)   from   PPOK_House
==========================

我现在要把这句加上一句外部给入的条件@str_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 '+@str_SQLWhere

exec sp_executesql @sql,N '@int_allid int output ',@int_allid output

热点排行