Join objects and schemas for querying a user-defined function : sys.schemas « System Tables Views « SQL Server / T-SQL Tutorial






7> IF EXISTS(SELECT * FROM sys.objects o JOIN sys.schemas s
8>     ON o.schema_id = s.schema_id
9>     WHERE o.type = 'P' AND
10>     s.name = 'Production' AND
11>     o.name = 'myProc')
12>     DROP PROCEDURE
13>         Production.myProc
14> GO








27.11.sys.schemas
27.11.1.Reporting on Database Views by joining sys.views and sys.schemas
27.11.2.Join objects and schemas
27.11.3.Join objects and schemas for querying a user-defined function