{"id":5079,"date":"2020-08-22T08:53:59","date_gmt":"2020-08-22T00:53:59","guid":{"rendered":"https:\/\/www.xttblog.com\/?p=5079"},"modified":"2020-08-22T08:53:59","modified_gmt":"2020-08-22T00:53:59","slug":"sql-server%e5%b8%b8%e7%94%a8%e4%bf%ae%e6%94%b9%e5%ad%97%e6%ae%b5%ef%bc%8c%e5%88%a0%e9%99%a4%e5%ad%97%e6%ae%b5%ef%bc%8c%e4%bf%ae%e6%94%b9%e9%bb%98%e8%ae%a4%e5%80%bc%e7%ad%89%e7%94%a8%e6%b3%95%e6%80%bb","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=5079","title":{"rendered":"SQL Server\u5e38\u7528\u4fee\u6539\u5b57\u6bb5\uff0c\u5220\u9664\u5b57\u6bb5\uff0c\u4fee\u6539\u9ed8\u8ba4\u503c\u7b49\u7528\u6cd5\u603b\u7ed3"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728\u6211\u56fd\uff0cSQL Server \u5e76\u4e0d\u6d41\u884c\uff0c\u76f8\u5bf9\u4e8e MySQL\u3001Oracle\u3001PostgreSQL \u6765\u8bf4\uff0cSQL Server \u53ef\u80fd\u6392\u5728\u7b2c\u4e09\u7b2c\u56db\u7684\u4f4d\u7f6e\u3002\u8981\u4e0d\u7136\uff0c\u4e5f\u4e0d\u4f1a\u627e\u4e00\u4e2a\u5b83\u7684 Java \u9a71\u52a8\u5305\u90fd\u5f88\u96be\u3002\u66f4\u522b\u8bf4\u67e5\u627e\u4e00\u4e9b\u5b83\u7684\u7528\u6cd5\u8d44\u6599\u4e86\uff0c\u4f60\u53ea\u5f97\u7ffb\u5b98\u7f51\uff0c\u770b\u5b83\u7684\u8bed\u6cd5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u8fd1\u6709\u4e00\u4f4d\u7c89\u4e1d\u5411\u6211\u6c42\u6559\uff0c\u6211\u8bf4\u8ba9\u4ed6\u5728\u767e\u5ea6\u4e0a\u641c\uff0c\u4ed6\u8bf4\u641c\u4e0d\u5230\uff0c\u5e76\u4e14\u8fd8\u7ed9\u6211\u53d1\u4e86\u7ea2\u5305\u3002\u867d\u7136\u7ea2\u5305\u6211\u6ca1\u6536\uff0c\u4f46\u662f\u6211\u8fd8\u662f\u5e2e\u4ed6\u628a\u4ed6\u7684\u95ee\u9898\u7ed9\u89e3\u51b3\u4e86\u3002\u4e0b\u9762\u6211\u603b\u7ed3\u4e86\u51e0\u4e2a\u5173\u4e8e SQL Server \u4fee\u6539\u5b57\u6bb5\u7684\u51e0\u4e2a\u5e38\u7528\u7684 SQL\uff0c\u5e0c\u671b\u80fd\u591f\u5e2e\u52a9\u5230\u4e00\u4e9b\u4eba\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- \u4fee\u6539\u5b57\u6bb5\u957f\u5ea6\nALTER TABLE tab_xttblog ALTER COLUMN url_name VARCHAR(255);\nALTER TABLE tab_xttblog ALTER COLUMN site_name VARCHAR(255);\n-- \u6dfb\u52a0\u5b57\u6bb5\nALTER TABLE tab_xttblog ADD context VARCHAR(2000);\n-- \u4fee\u6539\u6216\u65b0\u589e\u9ed8\u8ba4\u503c\nALTER TABLE tab_xttblog ADD status VARCHAR(255) default '\u4e1a\u4f59\u8349';\nALTER TABLE tab_xttblog ADD deleted int default 0;\n-- \u7ed9\u5b57\u6bb5 deleted \u6dfb\u52a0\u9ed8\u8ba4\u503c\nALTER TABLE tab_xttblog ADD DEFAULT 0 FOR deleted;\n-- \u4fee\u6539\u5b57\u6bb5\u540d\uff0c\u67d0\u4e9b\u7248\u672c\u7684 SQL Server\u53ef\u80fd\u4e0d\u652f\u6301\uff0c\u8bf7\u4f7f\u7528 EXEC \u8bed\u6cd5\nALTER TABLE tab_xttblog rename COLUMN context to xtt_context;\n-- \u9760\u8c31\u7684\u4fee\u6539\u5b57\u6bb5\u540d\u65b9\u6cd5\nEXEC sp_RENAME 'tab_a.context', 'xtt_context', 'COLUMN'\n-- \u5220\u9664\u8868\u5b57\u6bb5\nALTER TABLE tab_xttblog DROP COLUMN context;\n-- \u5220\u9664\u8868\nDROP TABLE tab_xttblog;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4e86\u7b80\u5355\uff0c\u6211\u4e0a\u9762\u5168\u7ed9\u8d34\u51fa\u6765\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u9762\u8fd9\u4e9b SQL \u4f60\u53ef\u80fd\u770b\u4e0d\u51fa\u6765\u6709\u4ec0\u4e48\u6280\u672f\u542b\u91cf\uff0c\u4f46\u662f\u901a\u8fc7\u767e\u5ea6\u641c\u7d22\u5230\u6211\u8fd9\u4e2a\u7f51\u9875\u7684\u4eba\u5f88\u591a\uff0c\u6240\u4ee5\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u4e3a\u4e86\u6d41\u91cf\u800c\u5199\uff01\u6b63\u6240\u8c13\uff0c\u8d8a\u7b80\u5355\u7684\u95ee\u9898\uff0c\u641c\u7d22\u7684\u4eba\u8d8a\u591a\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=5079\">SQL Server\u5e38\u7528\u4fee\u6539\u5b57\u6bb5\uff0c\u5220\u9664\u5b57\u6bb5\uff0c\u4fee\u6539\u9ed8\u8ba4\u503c\u7b49\u7528\u6cd5\u603b\u7ed3<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u5728\u6211\u56fd\uff0cSQL Server \u5e76\u4e0d\u6d41\u884c\uff0c\u76f8\u5bf9\u4e8e MySQL\u3001Oracle\u3001PostgreSQL \u6765\u8bf4\uff0cSQL  [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[1479,688,157,354,155],"class_list":["post-5079","post","type-post","status-publish","format-standard","hentry","category-sql","tag-sql-server","tag-sql"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/5079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5079"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/5079\/revisions"}],"predecessor-version":[{"id":5080,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/5079\/revisions\/5080"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}