sql - How can I get the number of rows in dynamic query's result? -


i have created 1 dynamic query , works well. execute query using:

exec sp_executesql @sqlquery 

where @sqlquery 1 dynamic query.

my question how can return number of rows present after execution of query? hope question clear.

thanks in advance:)

you can use @@rowcount return last query effected row count.

exec sp_executesql @sqlquery  declare @rowcount int set @rowcount = @@rowcount select @rowcount numofrows 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -