Join objects and schemas : sys.schemas « System Tables Views « SQL Server / T-SQL Tutorial






5> IF EXISTS(SELECT *
6>     FROM sys.objects o JOIN sys.schemas s
7>     ON o.schema_id = s.schema_id
8>     WHERE type = 'TR' AND
9>     s.name = 'dbo' AND
10>     o.name = 'trStudentsEcho')
11>     DROP TRIGGER trStudentsEcho
12> 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