Reputation: 534
How to find number of stored procedures, tables ,functions present in a Database?
Please help me finding the above.
Upvotes: 7
Views: 19437
Reputation: 15960
SELECT * FROM sysobjects WHERE (xtype = 'p')
You can get all the information from sysobjects
Upvotes: 0
Reputation: 25465
Simply
SELECT COUNT(*) FROM sysobjects WHERE xtype IN ('u', 'p', 'fn')
Hope this helps.
Upvotes: 2
Reputation: 174369
You can use sys.Tables
for the tables, sys.procedures
for stored procedures and this answer for functions.
Upvotes: 2
Reputation: 22698
select count(*)
from DatabaseName.information_schema.routines
where routine_type in ('PROCEDURE', 'FUNCTION', 'TABLE')
Upvotes: 6