Search code examples
sqlazuredata-warehouse

Script to get the procedure and schema name in azure data warehouse


I need a script which would print the procedure names and it's schema names in data warehouse. For example: If i have a stored procedure named as Stats.CountEmployees then I want a script which would print

ProcedureName  | SchemaName
------------------------------
CountEmployees | Stats

Solution

  • I used following query to get that info:

    SELECT
                s.name as schemaName, p.name AS ProcName
            FROM sys.procedures AS p
            inner join sys.schemas s on p.schema_id = s.schema_id
    

    Thanks