{"id":67769,"date":"2017-03-16T02:18:05","date_gmt":"2017-03-15T18:18:05","guid":{"rendered":"http:\/\/www.xiaoyebailong.com\/?p=67769"},"modified":"2017-03-16T02:18:05","modified_gmt":"2017-03-15T18:18:05","slug":"sql%e4%bd%9c%e4%b8%9a%e5%88%a0%e9%99%a4%e4%b8%8d%e4%ba%86%e6%89%a7%e8%a1%8c%e8%af%ad%e5%8f%a5","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2017\/03\/16\/67769.htm","title":{"rendered":"sql\u4f5c\u4e1a\u5220\u9664\u4e0d\u4e86\u6267\u884c\u8bed\u53e5"},"content":{"rendered":"<p>select * from sysmaintplan_log<br \/>\ndelete sysmaintplan_log<\/p>\n<p>select * from sysmaintplan_subplans<br \/>\ndelete sysmaintplan_subplans<br \/>\nUSE [msdb]<br \/>\nDECLARE @job_name VARCHAR(100)<br \/>\nSET @job_name = N&#8217;\u6570\u636e\u5907\u4efd.Subpaln_1&#8242; &#8212;<span style=\"color: #ff0000;\">\u4f5c\u4e1a\u91cc\u7684\u540d\u5b57\u8fd9\u91cc\u5f88\u5173\u952e<\/span><\/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>select * from sysmaintplan_log delete sysmaintplan_log select * from sysmaintplan_subplans delete sysmaintplan_subplans &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[106,273],"topic":[],"class_list":["post-67769","post","type-post","status-publish","format-standard","hentry","category-server","tag-sql","tag-273"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/67769","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=67769"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/67769\/revisions"}],"predecessor-version":[{"id":67770,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/67769\/revisions\/67770"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=67769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=67769"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=67769"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=67769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}