AspBucket offers ASP.NET, C#, VB, Jquery, CSS, Ajax, SQL tutorials. It is the best place for programmers to learn

Wednesday 7 October 2015

Get list of all stored Procedure & function in SQL server

In this Blog post we are going to discuss how to list all stored procedure in data base. List of Stored procedure & Function has been already in Object Explorer of SQL Server but you can also get list by SQL query, the best way is to use information_schema.

select * 
 from DatabaseName.information_schema.routines 
where routine_type = 'PROCEDURE'
If Procedure or function have suffix like sp_, p_, fn_ then query can filter all these type of procedures.
FROM    information_schema.routines
WHERE   routine_type = 'PROCEDURE'
AND LEFT(Routine_Name, 3)  IN ( 'sp_', 'p_', 'fn_' )


Post a Comment

  • Popular Posts
  • Comments