如何通过exec方法返回值
如下例子所示:
能把exec @strsql执行以后的结果返回给@return_status吗?
declare @return_status int
declare @strsql varchar(200)
select @strsql='SELECT Count(Proins_ID) FROM RT_PigeProStat WHERE not ZQ_DM like ''000'' AND ProDef_ID=1 AND Proinst_Type is null AND Start_Date>= '+ '''2003-11-23 00:00:00''' + ' AND End_Date<= '+ '''2004-11-23 00:00:00'''
print @strsql
exec @strsql