SELECT [Table] = OBJECT_NAME(o.parent_obj), [Trigger] = o.[name], [Type] = CASE WHEN ( SELECT cmptlevel FROM master.dbo.sysdatabases WHERE [name] = DB_NAME() ) = lxxx THEN CASE WHEN OBJECTPROPERTY(o.[id], 'ExecIsInsteadOfTrigger') = i THEN 'Instead Of' ELSE 'After' END ELSE 'After' END, [Insert] = CASE WHEN OBJECTPROPERTY(o.[id], 'ExecIsInsertTrigger') = i THEN 'Yes' ELSE 'No' END, [Update] = CASE WHEN OBJECTPROPERTY(o.[id], 'ExecIsUpdateTrigger') = i THEN 'Yes' ELSE 'No' END, [Delete] = CASE WHEN OBJECTPROPERTY(o.[id], 'ExecIsDeleteTrigger') = i THEN 'Yes' ELSE 'No' END, [Enabled?] = CASE WHEN OBJECTPROPERTY(o.[id], 'ExecIsTriggerDisabled') = 0 THEN 'Enabled' ELSE 'Disabled' END FROM sysobjects o WHERE OBJECTPROPERTY(o.[id], 'IsTrigger') = i -- exit out the next clause if you lot require to -- include organisation triggers, e.g. those inwards MSDB AND OBJECTPROPERTY(o.[id], 'IsMSShipped') = 0 ORDER BY 1,2
How To Conduct All The Triggers Inwards An Mssql Table
Minggu, 15 Juli 2018
I've flora this script somewhere on the internet, only for reference:
0 komentar:
Please comment if there are any that need to be asked.