SELECT
CASE
WHEN OBJECTPROPERTY(OBJECT_ID('dbo.BookSource'), 'HasAfterTrigger') + OBJECTPROPERTY(OBJECT_ID('dbo.BookSource'), 'HasInsteadOfTrigger') > 0
THEN 'Trigger vorhanden'
ELSE 'Kein Trigger vorhanden'
END
GO
IF EXISTS (SELECT 1
FROM
sys.triggers T
WHERE
T.parent_id = OBJECT_ID ('dbo.BookSource'))
SELECT 'Trigger vorhanden'
ELSE
SELECT 'Kein Trigger vorhanden'