{"id":2661,"date":"2013-04-28T02:25:00","date_gmt":"2013-04-28T02:25:00","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=2661"},"modified":"2013-04-28T02:25:00","modified_gmt":"2013-04-28T02:25:00","slug":"%e5%af%b9%e7%ad%89%e5%a4%8d%e5%88%b6%e5%88%a0%e9%99%a4article","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2013\/04\/28\/%e5%af%b9%e7%ad%89%e5%a4%8d%e5%88%b6%e5%88%a0%e9%99%a4article\/","title":{"rendered":"\u5bf9\u7b49\u590d\u5236\u5220\u9664article"},"content":{"rendered":"<pre class=\"brush:sql;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;\">\r\nSET QUOTED_IDENTIFIER ON \r\nGO\r\nSET ANSI_NULLS ON \r\nGO\r\n\r\nif exists (select * from dbo.sysobjects where id = object_id(N&#39;[dbo].[Repl_DropArticlePeer]&#39;) and OBJECTPROPERTY(id, N&#39;IsProcedure&#39;) = 1)\r\ndrop procedure [dbo].[Repl_DropArticlePeer]\r\nGO\r\n\r\n\/*\u5bf9\u7b49\u590d\u5236\u5220\u9664Article\r\n EXEC LS_DropArticlePeer &#39;testrepl&#39;\r\n*\/\r\nCREATE PROCEDURE Repl_DropArticlePeer\r\n@article AS sysname\r\nAS \r\nBEGIN \r\n\tIF ISNULL(@article,&#39;&#39;) = &#39;&#39;\r\n\tBEGIN\r\n\t\tRETURN\r\n\tEND  \r\n\r\n       DECLARE @publication AS sysname;  \r\n\tSET @publication =DB_NAME(); \r\n\t--SET @article = N&#39;testRepl&#39;\r\n\r\n\t--\u5220\u9664\u5bf9\u5e94\u8ba2\u9605\r\n\tIF @@SERVERNAME = &#39;DataBaseC&#39; --\u5728\u54ea\u53f0\u673a\u5668\u4e0a\u8fd0\u884c\uff0c\u5c31\u4e0d\u5220\u9664\u81ea\u5df1\r\n\tBEGIN\r\n\t\t--exec sp_dropsubscription @publication = @publication, @article = @article, @subscriber = &#39;databasec&#39;\r\n\t\texec sp_dropsubscription @publication =@publication, @article =@article, @subscriber = &#39;DataBaseD&#39;\r\n\t\texec sp_dropsubscription @publication = @publication, @article = @article, @subscriber = &#39;sqlcluster&#39;\r\n\tEND\r\n\tELSE IF @@SERVERNAME = &#39;DataBaseD&#39;\r\n\tBEGIN\r\n\t\texec sp_dropsubscription @publication = @publication, @article = @article, @subscriber = &#39;databasec&#39;\r\n\t\t--exec sp_dropsubscription @publication =@publication, @article =@article, @subscriber = &#39;DataBaseD&#39;\r\n\t\texec sp_dropsubscription @publication = @publication, @article = @article, @subscriber = &#39;sqlcluster&#39;\r\n\tEND\r\n\tELSE IF @@SERVERNAME = &#39;SQLCLUSTER&#39;\r\n\tBEGIN\r\n\t\texec sp_dropsubscription @publication = @publication, @article = @article, @subscriber = &#39;databasec&#39;\r\n\t\texec sp_dropsubscription @publication =@publication, @article =@article, @subscriber = &#39;DataBaseD&#39;\r\n\t\t--exec sp_dropsubscription @publication = @publication, @article = @article, @subscriber = &#39;sqlcluster&#39;\r\n\tEND\r\n\r\n\r\n\tEXEC sp_droparticle \r\n\t  @publication = @publication, \r\n\t  @article = @article,\r\n\t  @force_invalidate_snapshot = 1;\r\nEND \r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO if exi [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-2661","post","type-post","status-publish","format-standard","hentry","category-sql-server"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/comments?post=2661"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2661\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=2661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=2661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=2661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}