清理数据库订阅表

--清理数据库订阅表
 declare @id int 
 declare @content varchar(500)
 Declare Cur Cursor local For SELECT id FROM sys.dm_qn_subscriptions
 Open Cur
 Fetch next From Cur Into @id
 While @@fetch_status=0     
 Begin
    set @content = 'KILL QUERY NOTIFICATION SUBSCRIPTION  ' + convert( varchar(100),@id)
    exec(@content)
    Fetch Next From Cur Into @id
 End  
 Close Cur   

 

posted @ 2014-05-06 11:18  独孤求败  阅读(293)  评论(0编辑  收藏  举报