{"id":68179,"date":"2018-07-18T18:19:48","date_gmt":"2018-07-18T10:19:48","guid":{"rendered":"http:\/\/www.xiaoyebailong.com\/?p=68179"},"modified":"2018-07-26T18:19:59","modified_gmt":"2018-07-26T10:19:59","slug":"%e8%a7%a3%e5%86%b3-sqlserver-%e6%97%a0%e6%b3%95%e5%88%a0%e9%99%a4%e4%bd%9c%e4%b8%9a","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2018\/07\/18\/68179.htm","title":{"rendered":"\u89e3\u51b3 SQLSERVER \u65e0\u6cd5\u5220\u9664\u4f5c\u4e1a"},"content":{"rendered":"<p>USE [msdb]<br \/>\nDECLARE @job_name VARCHAR(100)<br \/>\nSET @job_name =&#8217;\u4f5c\u4e1a\u540d\u79f0&#8217;<\/p>\n<p>&#8211;\u6ce8\uff1ajobName\u4e3a\u7ef4\u62a4\u8ba1\u5212\u5bf9\u5e94\u7684jobName<br \/>\n&#8211;\u5220\u9664\u5728\u8ba1\u5212\u91cc\u9762\u7684\u65e5\u5fd7<br \/>\nDELETE<br \/>\nsysmaintplan_log<br \/>\nFROM<br \/>\nsysmaintplan_subplans AS subplans<br \/>\nINNER JOIN sysjobs_view AS syjobs ON subplans.job_id = syjobs.job_id<br \/>\nINNER JOIN sysmaintplan_log ON subplans.subplan_id =sysmaintplan_log.subplan_id<br \/>\nWHERE<br \/>\n(syjobs.name = @job_name)<\/p>\n<p>&#8211;\u5220\u9664\u4ee3\u7406\u7684\u4f5c\u4e1a<br \/>\nDELETE<br \/>\nsysjobschedules FROM sysjobs_view v<br \/>\nINNER JOIN sysjobschedules o ON v.job_id=o.job_id<br \/>\nWHERE<br \/>\nv.name=@job_name<\/p>\n<p>&#8211;\u5220\u9664\u5b50\u8ba1\u5212<br \/>\nDELETE<br \/>\nsysmaintplan_subplans<br \/>\nFROM<br \/>\nsysmaintplan_subplans AS subplans<br \/>\nINNER JOIN sysjobs_view AS syjobs ON subplans.job_id = syjobs.job_id<br \/>\nWHERE<br \/>\n(syjobs.name = @job_name)<\/p>\n<p>&#8211;\u5220\u9664\u4f5c\u4e1a<br \/>\nDELETE FROM msdb.dbo.sysjobs_view WHERE name = @job_name<\/p>\n","protected":false},"excerpt":{"rendered":"<p>USE [msdb] DECLARE @job_name VARCHAR(100) SET @job_name =&#8217;\u4f5c\u4e1a\u540d\u79f0&#8217; &#8211;\u6ce8\uff1ajobName\u4e3a\u7ef4\u62a4\u8ba1\u5212\u5bf9\u5e94\u7684jobName &#8211;\u5220\u9664\u5728\u8ba1\u5212&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,7],"tags":[274,420],"topic":[],"class_list":["post-68179","post","type-post","status-publish","format-standard","hentry","category-technology","category-server","tag-sqlserver","tag-420"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/68179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=68179"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/68179\/revisions"}],"predecessor-version":[{"id":68180,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/68179\/revisions\/68180"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=68179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=68179"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=68179"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=68179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}