Wednesday, November 16, 2011

How to list out the Stored Procedures in the database?:


Method 1 : SELECT name FROM SYS.OBJECTS WHERE type=’P’
Method 2 : SELECT name FROM SYS.PROCEDURES
Method 3 : SELECT name FROM SYS.ALL_OBJECTS WHERE type=’P’
Method 4 : SELECT NAME FROM SYSOBJECTS WHERE xtype=’P’
Method 5 : SELECT Routine_name FROM INFORMATION_SCHEMA.ROUTINES WHERE
ROUTINE_TYPE=’PROCEDURE’
The SYS.OBJECTS table has the common table that has the list for all the procedure, table, triggers, views,etc.., Here procedure can be filtered using the type=’p’.
The Information_schema.routines is a view that has used in the sql server 7.0 version. Now exclusive table avaiable for the stored procedure.