Reputation: 2153
I want statistic of each database in a SQL Server instance.
For each database, I want to know how many triggers, stored procedures, etc.
Maybe also link between databases.
Any stat useful for migration, usage report, statistical development.
Upvotes: 1
Views: 196
Reputation: 1514
This will do exactly what you need
EXECUTE master.sys.sp_MSforeachdb 'USE [?]; EXEC sp_spaceused'
This link gives you more details
There are a few other undocumented stored procedures, one for tables for example, that are useful.
Upvotes: 0
Reputation: 754220
Have a look at the Catalog Views in SQL Server - they tell you pretty much everything.
Number of triggers?
SELECT COUNT(*) FROM sys.triggers
Number of stored procedures?
SELECT COUNT(*) FROM sys.procedures
and so on - the possibilities are endless.....
Upvotes: 1