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'
SELECT T.[name] AS Trigger_Name, OBJECT_NAME(T.parent_id) AS Table_Name, TE.type_desc, T.create_date FROM sys.triggers T JOIN sys.trigger_events TE ON T.[object_id] = TE.[object_id];