Advertisement
bluebunny72

DROP replication triggers and procs and _all views

Sep 26th, 2016
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.43 KB | None | 0 0
  1. SET NOCOUNT ON
  2.  
  3. select      'DROP TRIGGER [dbo].[' + t.name + '];'         
  4. from        sys.triggers t
  5. join        sys.tables o
  6. on          o.object_id     = t.parent_id
  7. where       t.name  like    '%Replicate'
  8. order by    t.name
  9.  
  10. select 'DROP PROCEDURE [' + o.name + '];'
  11. from sys.objects o
  12. where type in (N'P', N'PC')
  13. and o.name LIKE 'ReplIup%' OR o.name LIKE 'ReplDel%'
  14.  
  15. --drop _all views
  16. select 'DROP VIEW [' + o.name + '];'
  17. from sys.views o
  18. where o.name LIKE '%_all'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement