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

javascript - Iterate over array and calculate average values of array-parts -

ASP.NET Javascript: window.open won't work twice -

jquery - Opera does not change the height of the page. Why? -