Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count Stored Procedures in Database?

How can i count the number of stored procedures in my database and is it a bad practice to have too many stored procedures?

like image 359
Jack Avatar asked Jan 14 '09 16:01

Jack


People also ask

How do I count a stored procedure in SQL Server?

You can find in sys. objects all types of objects in the database. You will have to run this query on each of your databases to see the count of objects. You can find all information about what is stored in sys.

How do I find Stored Procedures in all SQL Server databases?

Find Using Filter Settings In Object Explorer Below are the steps for using filter settings to find stored procedure. In the Object Explorer in SQL Server Management Studio, go to the database and expand it. Expand the Programmability folder. Right Click the Stored Procedures folder.

How do I count the number of functions in a SQL Server database?

SQL Server COUNT() is an aggregate function that returns the number of items found in a set. In this syntax: ALL instructs the COUNT() function to applies to all values.

How many procedures are there in SQL Server?

There are two types of stored procedures available in SQL Server: User defined stored procedures. System stored procedures.


2 Answers

Select count(*) from sysobjects where xtype = 'P'
like image 135
Jason Punyon Avatar answered Oct 22 '22 16:10

Jason Punyon


Select count(1) from information_schema.routines
where routine_type = 'PROCEDURE'
like image 44
cmsjr Avatar answered Oct 22 '22 16:10

cmsjr