Stored Procedures in a database

What would you do if as a DBA someone asks you that Hey, i need to know how many stored procedures are their in this database?

1 . you are gonna count all of them? of course not.

2. use your dba magic and save the time.

So i was asked today we need to compare if the two Databases have same number of SPs.

This is what i did :

SELECT COUNT(*) as [Sp Count]
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE=’PROCEDURE’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s