Monday, 9 May 2011

Enabling all disabled triggers in SQL Server


select 'ALTER TABLE ' + o.name + ' ENABLE TRIGGER ' + s.name
from sys.objects o
inner join sys.triggers s on s.parent_id = o.object_id
and s.is_disabled = 1

No comments:

Post a Comment

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...