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
Post a Comment