bluebunny72 icon

DROP replication triggers and procs and _all views

bluebunny72 | PRO | 09/27/16 04:06:34 AM UTC | 0 ⭐ | 471 👁️ | Never ⏰ | []
T-SQL |

430 B

|

None

|

0 👍

/

0 👎

SET NOCOUNT ON
 
select      'DROP TRIGGER [dbo].[' + t.name + '];'          
from        sys.triggers t
join        sys.tables o
on          o.object_id     = t.parent_id
where       t.name  like    '%Replicate'
order by    t.name
 
select 'DROP PROCEDURE [' + o.name + '];'
from sys.objects o
where type in (N'P', N'PC')
and o.name LIKE 'ReplIup%' OR o.name LIKE 'ReplDel%'
 
--drop _all views
select 'DROP VIEW [' + o.name + '];'
from sys.views o
where o.name LIKE '%_all'

Comments