List All Stored Procedures and Tables in MS SQL Database
By manik26 • Sep 9th, 2009 • Category: BlogOften times its important to see the list of stored procedures in a database. So how do you find list of stored procedures in a MS SQL database?
SELECT * FROM MyDatabase.sys.procedures
Where myDatabase is the name of the database.
You can omit the database name if you like, provided you are in that database.
And this is how you compare the name list of stored procedures in one database to another:
SELECT *
FROM MyDatabase1.sys.procedures
Where name not in(
SELECT name
FROM MyDatabase2.sys.procedures
)
And this is how you find the list of tables in a database:
SELECT * FROM MyDatabase1.sys.tables