{"id":171,"date":"2011-11-29T10:19:03","date_gmt":"2011-11-29T02:19:03","guid":{"rendered":"http:\/\/www.royalwzy.com\/?p=171"},"modified":"2013-12-30T14:18:03","modified_gmt":"2013-12-30T06:18:03","slug":"%e5%88%86%e7%a6%bb%e5%92%8c%e9%99%84%e5%8a%a0%e6%95%b0%e6%8d%ae%e5%ba%93%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"http:\/\/www.royalwzy.com\/?p=171","title":{"rendered":"\u5206\u79bb\u548c\u9644\u52a0\u6570\u636e\u5e93\u6587\u4ef6"},"content":{"rendered":"<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\">\u5728\u5206\u79bb\u548c\u9644\u52a0\u6570\u636e\u5e93\u65f6\u53ef\u4ee5\u4f7f\u7528<\/span><span lang=\"en-US\">sp_detach_db,<\/span><span lang=\"zh-CN\">sp_attach_db\u548csp_attach_single_file_db\u7cfb\u7edf\u5b58\u50a8\u8fc7\u7a0b<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u8fd9\u4e09\u4e2a\u5b58\u50a8\u8fc7\u7a0b<\/span><span lang=\"zh-CN\">\u5bf9\u4e8eSQL<\/span><span lang=\"en-US\">\u00a0<\/span><span lang=\"zh-CN\">Server\u6570\u636e\u5e93\u7ba1\u7406\u5458\u6267\u884c<\/span><span lang=\"zh-CN\">\u4ee5\u4e0b<\/span><span lang=\"zh-CN\">\u7684\u4efb\u52a1\u662f\u975e\u5e38\u65b9\u4fbf\u7684<\/span><span lang=\"en-US\">:<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">1.<\/span><span lang=\"zh-CN\">\u4f7f\u7528sp_detach_db\u5c06\u6570\u636e\u5e93\u4ece\u4e00\u4e2a\u670d\u52a1\u5668\u5206\u79bb;<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">2.<\/span><span lang=\"zh-CN\">\u4f7f\u7528sp_attach_db\u7cfb\u7edf\u5b58\u50a8\u8fc7\u7a0b\u76f4\u63a5\u5c06.<\/span><span lang=\"en-US\">mdf<\/span><span lang=\"zh-CN\">\u548c.<\/span><span lang=\"en-US\">ldf<\/span><span lang=\"zh-CN\">\u6587\u4ef6\u9644\u52a0\u5230<\/span><span lang=\"zh-CN\">\u6570\u636e\u5e93<\/span><span lang=\"zh-CN\">\u670d\u52a1\u5668<\/span><span lang=\"en-US\">;<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">3.<\/span><span lang=\"zh-CN\">\u4f7f\u7528sp_attach_single_file_db\u7cfb\u7edf\u5b58\u50a8\u8fc7\u7a0b\u53ea\u9644\u52a0.<\/span><span lang=\"en-US\">mdf<\/span><span lang=\"zh-CN\">\u6587\u4ef6<\/span><span lang=\"en-US\">;<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\">\u5c3d\u7ba1<\/span><span lang=\"zh-CN\">\u5b83\u4eec<\/span><span lang=\"zh-CN\">\u5bf9\u4e8eSQL Server\u6570\u636e\u5e93\u7ba1\u7406\u5458\u662f\u5f88\u6709\u7528\u7684<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u4f46\u662f\u5728\u4f7f\u7528\u8fd9\u4e24\u4e2a\u5b58\u50a8\u8fc7\u7a0b\u65f6\u662f\u6709\u4e00\u4e9b\u9650\u5236\u7684<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u5982<\/span><span lang=\"en-US\">:<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\">1<\/span><span lang=\"en-US\">.<\/span><span lang=\"zh-CN\">\u4e0d\u80fd\u9644\u52a0\u591a\u4e2a\u65e5\u5fd7\u6587\u4ef6<\/span><span lang=\"en-US\">;<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\">2<\/span><span lang=\"en-US\">.<\/span><span lang=\"zh-CN\">\u4e0d\u80fd\u9644\u52a016\u4e2a\u4ee5\u4e0a\u7684\u6587\u4ef6<\/span><span lang=\"en-US\">;<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\">\u5728SQL Server 2008\u4e2d<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u5fae\u8f6f\u5ba3\u5e03\u4e0a\u9762\u7684\u7cfb\u7edf\u5b58\u50a8\u8fc7\u7a0b\u5c06\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u88ab\u5e9f\u5f03<\/span><span lang=\"en-US\">.<\/span><span lang=\"zh-CN\">\u800c\u5728<\/span><span lang=\"en-US\">&#8220;CREATE DATABASE&#8221;<\/span><span lang=\"zh-CN\">SQL\u8bed\u53e5\u4e2d\u6dfb\u52a0\u4e86\u4e00\u4e2a\u4ece\u53e5&#8221;<\/span><span lang=\"en-US\">FOR ATTACH<\/span><span lang=\"zh-CN\">&#8220;<\/span><span lang=\"en-US\">.<\/span><span lang=\"zh-CN\">\u5e76\u5efa\u8bae\u5e94\u8be5\u4f7f\u7528<\/span><span lang=\"en-US\">&#8220;<\/span><span lang=\"zh-CN\">CREATE DATABASE database_name FOR ATTACH<\/span><span lang=\"en-US\">&#8220;<\/span><span lang=\"zh-CN\">\u8bed\u53e5<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\">\u4e0b\u9762\u4ecb\u7ecd\u4f7f\u7528&#8221;<\/span><span lang=\"en-US\">FOR ATTACH<\/span><span lang=\"zh-CN\">&#8220;\u8bed\u53e5\u7684\u7528\u6cd5<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u4ee5\u514b\u670d\u5728\u4f7f\u7528sp_attach_db\u548csp_attach_single_file_db\u65f6\u8981\u9762\u4e34\u7684\u9650\u5236<\/span><span lang=\"en-US\">.<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">1.<\/span><span lang=\"zh-CN\">\u521b\u5efa\u5b9e\u4f8b\u6570\u636e\u5e93<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\">\n<div class=\"dp-highlighter bg_c-sharp\" style=\"font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #e7e5dc; width: 687.046875px; overflow: auto; padding-top: 1px; margin-top: 18px !important; margin-bottom: 18px !important;\">\n<div class=\"bar\" style=\"padding-left: 45px;\">\n<div class=\"tools\" style=\"padding: 3px 8px 10px 10px; font-style: normal; font-variant: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; background-color: #f8f8f8; border-left-width: 3px; border-left-style: solid; border-left-color: #6ce26c;\"><b>[c-sharp]<\/b>\u00a0<a class=\"ViewSource\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_plain.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"view plain\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">view plain<\/a><a class=\"CopyToClipboard\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_copy.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"copy\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">copy<\/a><\/p>\n<div style=\"position: absolute; left: 553px; top: 760px; width: 18px; height: 18px; z-index: 99;\"><\/div>\n<\/div>\n<\/div>\n<ol class=\"dp-c\" style=\"padding-left: 0px; border-style: none; background-color: #ffffff; color: #5c5c5c; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 45px !important;\" start=\"1\">\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\"><span style=\"border-style: none; background-color: inherit;\">USE\u00a0master\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">CREATE\u00a0DATABASE\u00a0Test\u00a0ON\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">(NAME\u00a0=\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;Test&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">,\u00a0FILENAME\u00a0=\u00a0<\/span><span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;D:\/Test.mdf&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">,\u00a0SIZE\u00a0=\u00a03072KB\u00a0,\u00a0FILEGROWTH\u00a0=\u00a01024KB\u00a0)\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">LOG\u00a0ON\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">(NAME\u00a0=\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;Test_log&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">,\u00a0FILENAME\u00a0=\u00a0<\/span><span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;D:\/Test_log.ldf&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">,\u00a0SIZE\u00a0=\u00a01024KB\u00a0,\u00a0FILEGROWTH\u00a0=\u00a010%)\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<\/ol>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">2.<\/span><span lang=\"zh-CN\">\u4f7f\u7528sp_detach_db\u5206\u79bb\u8be5\u6570\u636e\u5e93<\/span><span lang=\"zh-CN\">\u5e76\u4f7f\u7528<\/span><span lang=\"zh-CN\">sp_attach_db\u5c06\u5b83\u91cd\u65b0\u9644\u52a0<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\">\n<div class=\"dp-highlighter bg_c-sharp\" style=\"font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #e7e5dc; width: 687.046875px; overflow: auto; padding-top: 1px; margin-top: 18px !important; margin-bottom: 18px !important;\">\n<div class=\"bar\" style=\"padding-left: 45px;\">\n<div class=\"tools\" style=\"padding: 3px 8px 10px 10px; font-style: normal; font-variant: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; background-color: #f8f8f8; border-left-width: 3px; border-left-style: solid; border-left-color: #6ce26c;\"><b>[c-sharp]<\/b>\u00a0<a class=\"ViewSource\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_plain.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"view plain\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">view plain<\/a><a class=\"CopyToClipboard\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_copy.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"copy\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">copy<\/a><\/p>\n<div style=\"position: absolute; left: 553px; top: 981px; width: 18px; height: 18px; z-index: 99;\"><\/div>\n<\/div>\n<\/div>\n<ol class=\"dp-c\" style=\"padding-left: 0px; border-style: none; background-color: #ffffff; color: #5c5c5c; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 45px !important;\" start=\"1\">\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\"><span style=\"border-style: none; background-color: inherit;\">USE\u00a0master\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">&#8212;\u00a0\u5206\u79bb\u6570\u636e\u5e93\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">EXEC\u00a0sp_detach_db\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;Test&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">&#8212;\u00a0\u9644\u52a0\u6570\u636e\u5e93\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">EXEC\u00a0sp_attach_db\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;Test&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">,\u00a0<\/span><span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;D:\/Test.mdf&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">,\u00a0<\/span><span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;D:\/Test_log.ldf&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<\/ol>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">3.<\/span><span lang=\"zh-CN\">\u4f7f\u7528<\/span><span lang=\"en-US\">&#8220;CREATE DATABASE\u00a0<\/span><span lang=\"zh-CN\">database_name<\/span><span lang=\"en-US\">\u00a0FOR ATTACH&#8221;<\/span><span lang=\"zh-CN\">\u8bed\u53e5\u9644\u52a0\u6570\u636e\u5e93<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\">\n<div class=\"dp-highlighter bg_c-sharp\" style=\"font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #e7e5dc; width: 687.046875px; overflow: auto; padding-top: 1px; margin-top: 18px !important; margin-bottom: 18px !important;\">\n<div class=\"bar\" style=\"padding-left: 45px;\">\n<div class=\"tools\" style=\"padding: 3px 8px 10px 10px; font-style: normal; font-variant: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; background-color: #f8f8f8; border-left-width: 3px; border-left-style: solid; border-left-color: #6ce26c;\"><b>[c-sharp]<\/b>\u00a0<a class=\"ViewSource\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_plain.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"view plain\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">view plain<\/a><a class=\"CopyToClipboard\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_copy.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"copy\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">copy<\/a><\/p>\n<div style=\"position: absolute; left: 553px; top: 1220px; width: 18px; height: 18px; z-index: 99;\"><\/div>\n<\/div>\n<\/div>\n<ol class=\"dp-c\" style=\"padding-left: 0px; border-style: none; background-color: #ffffff; color: #5c5c5c; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 45px !important;\" start=\"1\">\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\"><span style=\"border-style: none; background-color: inherit;\">USE\u00a0master\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">&#8212;\u00a0\u5206\u79bb\u6570\u636e\u5e93\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">EXEC\u00a0sp_detach_db\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;Test&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">&#8212;\u00a0\u4f7f\u7528<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8220;CREATE\u00a0DATABASE\u00a0database_name\u00a0FOR\u00a0ATTACH&#8221;<\/span><span style=\"border-style: none; background-color: inherit;\">\u9644\u52a0\u6570\u636e\u5e93\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">CREATE\u00a0DATABASE\u00a0Test\u00a0ON\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">(FILENAME\u00a0=\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;D:\/Test.mdf&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">),\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">(FILENAME\u00a0=\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;D:\/Test_log.ldf&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">)\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">FOR\u00a0ATTACH\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<\/ol>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">4.<\/span><span lang=\"zh-CN\">\u5206\u79bb\u6570\u636e\u5e93\u5e76\u5220\u9664\u65e5\u5fd7<\/span><span lang=\"en-US\">(.ldf)<\/span><span lang=\"zh-CN\">\u6587\u4ef6<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\">\n<div class=\"dp-highlighter bg_c-sharp\" style=\"font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #e7e5dc; width: 687.046875px; overflow: auto; padding-top: 1px; margin-top: 18px !important; margin-bottom: 18px !important;\">\n<div class=\"bar\" style=\"padding-left: 45px;\">\n<div class=\"tools\" style=\"padding: 3px 8px 10px 10px; font-style: normal; font-variant: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; background-color: #f8f8f8; border-left-width: 3px; border-left-style: solid; border-left-color: #6ce26c;\"><b>[c-sharp]<\/b>\u00a0<a class=\"ViewSource\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_plain.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"view plain\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">view plain<\/a><a class=\"CopyToClipboard\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_copy.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"copy\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">copy<\/a><\/p>\n<div style=\"position: absolute; left: 553px; top: 1513px; width: 18px; height: 18px; z-index: 99;\"><\/div>\n<\/div>\n<\/div>\n<ol class=\"dp-c\" style=\"padding-left: 0px; border-style: none; background-color: #ffffff; color: #5c5c5c; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 45px !important;\" start=\"1\">\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\"><span style=\"border-style: none; background-color: inherit;\">USE\u00a0master\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">&#8212;\u00a0\u5206\u79bb\u6570\u636e\u5e93\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">EXEC\u00a0sp_detach_db\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;Test&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">&#8212;\u00a0\u5220\u9664\u65e5\u5fd7\u6587\u4ef6\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">EXEC\u00a0master..xp_cmdshell\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;del\u00a0&#8220;D:\/Test_log.ldf&#8221;&#8216;<\/span><span style=\"border-style: none; background-color: inherit;\">\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">&#8212;\u00a0\u5982\u679ccmdshell\u529f\u80fd\u4e0d\u53ef\u4f7f\u7528\u5219\u4f7f\u7528\u4e0b\u9762\u8bed\u53e5\u6fc0\u6d3bcmdshell\u529f\u80fd\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">USE\u00a0master\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">sp_configure\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;show\u00a0advanced\u00a0options&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">,\u00a01\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">RECONFIGURE\u00a0WITH\u00a0OVERRIDE\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">SP_CONFIGURE\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;xp_cmdshell&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">,\u00a01\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">RECONFIGURE\u00a0WITH\u00a0OVERRIDE\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<\/ol>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">5.<\/span><span lang=\"zh-CN\">\u4f7f\u7528sp_attach_single_file_db\u9644\u52a0.<\/span><span lang=\"en-US\">mdf<\/span><span lang=\"zh-CN\">\u6587\u4ef6<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\">\n<div class=\"dp-highlighter bg_c-sharp\" style=\"font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #e7e5dc; width: 687.046875px; overflow: auto; padding-top: 1px; margin-top: 18px !important; margin-bottom: 18px !important;\">\n<div class=\"bar\" style=\"padding-left: 45px;\">\n<div class=\"tools\" style=\"padding: 3px 8px 10px 10px; font-style: normal; font-variant: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; background-color: #f8f8f8; border-left-width: 3px; border-left-style: solid; border-left-color: #6ce26c;\"><b>[c-sharp]<\/b>\u00a0<a class=\"ViewSource\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_plain.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"view plain\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">view plain<\/a><a class=\"CopyToClipboard\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_copy.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"copy\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">copy<\/a><\/p>\n<div style=\"position: absolute; left: 553px; top: 1932px; width: 18px; height: 18px; z-index: 99;\"><\/div>\n<\/div>\n<\/div>\n<ol class=\"dp-c\" style=\"padding-left: 0px; border-style: none; background-color: #ffffff; color: #5c5c5c; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 45px !important;\" start=\"1\">\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\"><span style=\"border-style: none; background-color: inherit;\">USE\u00a0master\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">EXEC\u00a0sp_attach_single_file_db\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;Test&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">,\u00a0<\/span><span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;D:\/Test.mdf&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<\/ol>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">6.<\/span><span lang=\"zh-CN\">\u5220\u9664\u65e5\u5fd7\u6587\u4ef6<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u4f7f\u7528<\/span><span lang=\"en-US\">&#8220;CREATE DATABASE\u00a0<\/span><span lang=\"zh-CN\">database_name<\/span><span lang=\"en-US\">\u00a0FOR\u00a0<\/span><span lang=\"zh-CN\">ATTACH_REBUILD_LOG<\/span><span lang=\"en-US\">&#8220;<\/span><span lang=\"zh-CN\">\u9644\u52a0\u6570\u636e\u5e93<\/span><\/span><\/span><\/p>\n<p style=\"color: #333333; font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; font-size: 9pt;\">\n<div class=\"dp-highlighter bg_c-sharp\" style=\"font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #e7e5dc; width: 687.046875px; overflow: auto; padding-top: 1px; margin-top: 18px !important; margin-bottom: 18px !important;\">\n<div class=\"bar\" style=\"padding-left: 45px;\">\n<div class=\"tools\" style=\"padding: 3px 8px 10px 10px; font-style: normal; font-variant: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; background-color: #f8f8f8; border-left-width: 3px; border-left-style: solid; border-left-color: #6ce26c;\"><b>[c-sharp]<\/b>\u00a0<a class=\"ViewSource\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_plain.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"view plain\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">view plain<\/a><a class=\"CopyToClipboard\" style=\"color: #a0a0a0; background-image: url('http:\/\/static.blog.csdn.net\/scripts\/SyntaxHighlighter\/styles\/images\/default\/ico_copy.gif'); background-color: inherit; border-style: none; padding: 1px; margin-right: 10px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;\" title=\"copy\" href=\"http:\/\/blog.csdn.net\/royalwzy\/article\/details\/6161042#\">copy<\/a><\/p>\n<div style=\"position: absolute; left: 553px; top: 2099px; width: 18px; height: 18px; z-index: 99;\"><\/div>\n<\/div>\n<\/div>\n<ol class=\"dp-c\" style=\"padding-left: 0px; border-style: none; background-color: #ffffff; color: #5c5c5c; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 45px !important;\" start=\"1\">\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\"><span style=\"border-style: none; background-color: inherit;\">USE\u00a0master\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">EXEC\u00a0sp_detach_db\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;Test&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">\u00a0\u00a0<\/span><\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">&#8212;\u00a0\u5220\u9664\u65e5\u5fd7\u6587\u4ef6\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">EXEC\u00a0master..xp_cmdshell\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;del\u00a0&#8220;D:\/Test_log.ldf&#8221;&#8216;<\/span><span style=\"border-style: none; background-color: inherit;\">\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">&#8212;\u00a0\u4f7f\u7528<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8220;CREATE\u00a0DATABASE\u00a0database_name\u00a0FOR\u00a0ATTACH_REBUILD_LOG&#8221;<\/span><span style=\"border-style: none; background-color: inherit;\">\u9644\u52a0\u6570\u636e\u5e93\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">CREATE\u00a0DATABASE\u00a0Test\u00a0ON\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">(FILENAME\u00a0=\u00a0<span class=\"string\" style=\"border-style: none; color: blue; background-color: inherit;\">&#8216;D:\/Test.mdf&#8217;<\/span><span style=\"border-style: none; background-color: inherit;\">)\u00a0\u00a0<\/span><\/span><\/li>\n<li class=\"alt\" style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">FOR\u00a0ATTACH_REBUILD_LOG\u00a0\u00a0<\/span><\/li>\n<li style=\"border-style: none none none solid; border-left-width: 3px; border-left-color: #6ce26c; list-style: decimal-leading-zero outside; background-color: #f8f8f8; line-height: 18px; padding-right: 3px !important; padding-left: 10px !important;\"><span style=\"border-style: none; color: black; background-color: inherit;\">GO \u00a0<\/span><\/li>\n<\/ol>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5206\u79bb\u548c\u9644\u52a0\u6570\u636e\u5e93\u65f6\u53ef\u4ee5\u4f7f\u7528sp_detach_db,sp_attach_db\u548csp_attach_singl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[16],"class_list":["post-171","post","type-post","status-publish","format-standard","hentry","category-sqlserver","tag-sql_server_2008_r2"],"_links":{"self":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=171"}],"version-history":[{"count":0,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/171\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}