INFORMATION_SCHEMA.ROUTINES
To query INFORMATION_SCHEMA.ROUTINES views you can use the following Syntax:
Syntax:
SELECT Required Columns,
FROM INFORMATION_SCHEMA.ROUTINES;
Example: To get information about all the stored procedures in the database you can execute the following query:
Query:
SELECT SPECIFIC_NAME, ROUTINE_CATALOG, ROUTINE_SCHEMA, ROUTINE_NAME, ROUTINE_TYPE
FROM INFORMATION_SCHEMA.ROUTINES;
Output:
Explanation: The above returns an output table having 5 columns. Where each column of the output table provides information about the stored procedures of the database.
How to use INFORMATION_SCHEMA Views in SQL Server
In SQL Server, INFORMATION_SCHEMA Views are a set of views provided by the INFORMATION_SCHEMA database in the SQL server that stores the metadata of the databases, tables, columns, and other objects stored in the system. In this article, we will learn how to use INFORMATION_SCHEMA Views in SQL Server.