Finding All Stored Procedures and Functions in a database

Here is a basic query you can use to find All the Stored Procedures, Functions, and Views within your database. This is very usefully for several reasons.

Let us say you were assigned to a project another DBA or a developer created and maintained the stored procedures, functions, or views.

Type Initial(s)        Type Of Object Returned
FN      SQL Scalar Function
IF      Inline Table Valued Function
P      SQL Stored Procedure
PC      CLR Stored Procedure
TF      SQL Table Valued Function
V      View
X      Extended Stored Procedure

USE [your_database_name_here];

SELECT * FROM sys.all_objects
WHERE ([type] = ‘P’ OR [type] = ‘X’ OR [type] = ‘PC’)
ORDER BY [name];

Hope this helps.


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s