You have given very little info.
what [StoredPRoc]
does ? Like [StoredPRoc]
also return some result and Select * from TempSurpacData
also return some result then you need count of which resultset.
we do make sure the user query returns rows prior to saving it.
when you can do this then surely you can find row count in same place, just we don't know what code is use there.
The first query I am not in control of this is entered by a user via
textbox in our app
What do you mean by this ? Does user enter only DROP TABLE IF EXISTS TempData
or your complete example.
This is just layman example.
declare @i varchar(500)='DROP TABLE IF EXISTS TempData
EXEC [StoredPRoc]
Select * from TempSurpacData'
exec(@i)
Select @@ROWCOUNT
Suppose in my exampe both EXEC [StoredPRoc]
and Select * from TempSurpacData
return rows then
Select @@ROWCOUNT
will give number of rows return by Select * from TempSurpacData