Thursday, December 9, 2010

Find list of all Procedures, Functions and Views in SQL server 2005

You can find a SP, Function or View definition by using following command.


Syntax:
     exec sp_helptext <object name>
Eg:
exec sp_helptext 'dbo.ADD_NEW'


Some instances we need to find list of Procedures, Functions and Views those exits in the database.  Following script will help you to resolve your problem.

Eg:
USE MUBASHER_PRICE;
GO
SELECT * FROM SYSobjects
 WHERE [type] = 'P'
   AND [NAME] IN ('ADD_NEWS','ADM_ADD_WS_SPLIT','ADM_ADDNEW_APP_FILES')
ORDER BY [name];
GO

No comments:

Post a Comment