DECLARE trCursor CURSOR FOR 
SELECT OBJECT_NAME(parent_id) AS tableName, name as triggerName 
FROM sys.triggers
WHERE name like 'tr%Log'

DECLARE 
@tableName nvarchar(100),
@triggerName nvarchar(100),
@sql nvarchar(max)

OPEN trCursor
FETCH NEXT FROM trCursor INTO @tableName, @triggerName
WHILE @@FETCH_STATUS = 0 BEGIN

SET @sql = 'DISABLE TRIGGER ' + @triggerName + ' ON ' + @tableName + ';'

EXEC sys.sp_executesql @sql

FETCH NEXT FROM trCursor INTO @tableName, @triggerName
END

CLOSE trCursor
DEALLOCATE trCursor
GO


DECLARE trCursor CURSOR FOR 
SELECT OBJECT_NAME(parent_id) AS tableName, name as triggerName 
FROM sys.triggers
WHERE name like 'tr_AsyncAudit%'

DECLARE 
@tableName nvarchar(100),
@triggerName nvarchar(100),
@sql nvarchar(max)

OPEN trCursor
FETCH NEXT FROM trCursor INTO @tableName, @triggerName
WHILE @@FETCH_STATUS = 0 BEGIN

SET @sql = 'DISABLE TRIGGER ' + @triggerName + ' ON ' + @tableName + ';'

EXEC sys.sp_executesql @sql

FETCH NEXT FROM trCursor INTO @tableName, @triggerName
END

CLOSE trCursor
DEALLOCATE trCursor
GO