Skip to content
Advertisement

Getting Count of Result Sets of SP (SP_MSForeachtable)

I was going to list all of the Tables in my DB which have no records.
As same as most of the times I used SP_MSforeachtable like:

And this gives me many result sets which I need to count them now.

![result sets pic


I know there are other ways to work with tables but I was thinking getting count of sys.sp_MSforeachtable (or any SP) result sets
might be usefull.


Also if there is way to union all this result sets I will appreciate to share.

Advertisement

Answer

You can use this query to extract the information you require

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement