Monday, August 4, 2014

Dynamic Function

Replace your @vSql with this:



SELECT @vSql='SELECT @vRowCnt = COUNT(*) FROM '+@vTableName+' WHERE '+@vDtColName+'>='+@vInDate

@vRowCnt has to be inside the dynamic SQL context.


~ J.


No comments:

Post a Comment