{"id":140286,"date":"2024-10-31T20:28:21","date_gmt":"2024-10-31T12:28:21","guid":{"rendered":"https:\/\/server.hk\/cnblog\/140286\/"},"modified":"2024-10-31T20:28:22","modified_gmt":"2024-10-31T12:28:22","slug":"sql-server%e7%b4%a2%e5%bc%95%e8%88%87%e5%85%b6%e6%80%a7%e8%83%bd%e7%9a%84%e6%8f%8f%e8%bf%b0","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/140286\/","title":{"rendered":"SQL Server\u7d22\u5f15\u8207\u5176\u6027\u80fd\u7684\u63cf\u8ff0"},"content":{"rendered":"<h1 id=\"sql-server%e7%b4%a2%e5%bc%95%e8%88%87%e5%85%b6%e6%80%a7%e8%83%bd%e7%9a%84%e6%8f%8f%e8%bf%b0-WmsPIWUPan\">SQL Server\u7d22\u5f15\u8207\u5176\u6027\u80fd\u7684\u63cf\u8ff0<\/h1>\n<p>\u5728\u8cc7\u6599\u5eab\u7ba1\u7406\u7cfb\u7d71\u4e2d\uff0c\u7d22\u5f15\u662f\u4e00\u7a2e\u91cd\u8981\u7684\u8cc7\u6599\u7d50\u69cb\uff0c\u80fd\u5920\u986f\u8457\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\u3002SQL Server\u4f5c\u70ba\u4e00\u500b\u5ee3\u6cdb\u4f7f\u7528\u7684\u95dc\u806f\u8cc7\u6599\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u63d0\u4f9b\u4e86\u591a\u7a2e\u7d22\u5f15\u985e\u578b\uff0c\u5e6b\u52a9\u7528\u6236\u512a\u5316\u8cc7\u6599\u5b58\u53d6\u901f\u5ea6\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0eSQL Server\u4e2d\u7684\u7d22\u5f15\u53ca\u5176\u5c0d\u6027\u80fd\u7684\u5f71\u97ff\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af%e7%b4%a2%e5%bc%95%ef%bc%9f-WmsPIWUPan\">\u4ec0\u9ebc\u662f\u7d22\u5f15\uff1f<\/h2>\n<p>\u7d22\u5f15\u662f\u4e00\u7a2e\u8cc7\u6599\u7d50\u69cb\uff0c\u65e8\u5728\u52a0\u901f\u8cc7\u6599\u6aa2\u7d22\u3002\u5b83\u985e\u4f3c\u65bc\u66f8\u7c4d\u7684\u76ee\u9304\uff0c\u80fd\u5920\u5e6b\u52a9\u8cc7\u6599\u5eab\u5feb\u901f\u5b9a\u4f4d\u6240\u9700\u7684\u8cc7\u6599\u3002SQL Server\u4e2d\u7684\u7d22\u5f15\u53ef\u4ee5\u5206\u70ba\u5169\u5927\u985e\uff1a\u805a\u96c6\u7d22\u5f15\u548c\u975e\u805a\u96c6\u7d22\u5f15\u3002<\/p>\n<h3 id=\"%e8%81%9a%e9%9b%86%e7%b4%a2%e5%bc%95-WmsPIWUPan\">\u805a\u96c6\u7d22\u5f15<\/h3>\n<p>\u805a\u96c6\u7d22\u5f15\u662f\u5c07\u8cc7\u6599\u8868\u4e2d\u7684\u8cc7\u6599\u6309\u7167\u7d22\u5f15\u9375\u7684\u9806\u5e8f\u6392\u5217\u3002\u6bcf\u500b\u8cc7\u6599\u8868\u53ea\u80fd\u6709\u4e00\u500b\u805a\u96c6\u7d22\u5f15\uff0c\u56e0\u70ba\u8cc7\u6599\u53ea\u80fd\u4ee5\u4e00\u7a2e\u65b9\u5f0f\u6392\u5e8f\u3002\u805a\u96c6\u7d22\u5f15\u7684\u4e3b\u8981\u7279\u9ede\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u8cc7\u6599\u7684\u7269\u7406\u9806\u5e8f\u8207\u7d22\u5f15\u7684\u908f\u8f2f\u9806\u5e8f\u76f8\u540c\u3002<\/li>\n<li>\u9069\u5408\u7528\u65bc\u7bc4\u570d\u67e5\u8a62\uff0c\u56e0\u70ba\u76f8\u9130\u7684\u8cc7\u6599\u884c\u6703\u88ab\u5b58\u5132\u5728\u4e00\u8d77\u3002<\/li>\n<li>\u5728\u63d2\u5165\u3001\u66f4\u65b0\u6216\u522a\u9664\u8cc7\u6599\u6642\uff0c\u53ef\u80fd\u6703\u5c0e\u81f4\u9801\u9762\u5206\u88c2\uff0c\u5f71\u97ff\u6027\u80fd\u3002<\/li>\n<\/ul>\n<h3 id=\"%e9%9d%9e%e8%81%9a%e9%9b%86%e7%b4%a2%e5%bc%95-WmsPIWUPan\">\u975e\u805a\u96c6\u7d22\u5f15<\/h3>\n<p>\u975e\u805a\u96c6\u7d22\u5f15\u5247\u662f\u5c07\u7d22\u5f15\u8207\u8cc7\u6599\u5206\u958b\u5b58\u5132\u3002\u6bcf\u500b\u8cc7\u6599\u8868\u53ef\u4ee5\u6709\u591a\u500b\u975e\u805a\u96c6\u7d22\u5f15\uff0c\u9019\u4f7f\u5f97\u5b83\u5011\u5728\u67e5\u8a62\u6027\u80fd\u4e0a\u5177\u6709\u66f4\u5927\u7684\u9748\u6d3b\u6027\u3002\u975e\u805a\u96c6\u7d22\u5f15\u7684\u7279\u9ede\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u7d22\u5f15\u4e2d\u5305\u542b\u6307\u5411\u8cc7\u6599\u884c\u7684\u6307\u6a19\uff0c\u800c\u4e0d\u662f\u8cc7\u6599\u672c\u8eab\u3002<\/li>\n<li>\u9069\u5408\u7528\u65bc\u67e5\u8a62\u4e2d\u7d93\u5e38\u4f7f\u7528\u7684\u5217\uff0c\u7279\u5225\u662f\u90a3\u4e9b\u4e0d\u5728\u805a\u96c6\u7d22\u5f15\u4e2d\u7684\u5217\u3002<\/li>\n<li>\u53ef\u4ee5\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\uff0c\u4f46\u6703\u589e\u52a0\u8cc7\u6599\u5eab\u7684\u5b58\u5132\u9700\u6c42\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b4%a2%e5%bc%95%e5%b0%8d%e6%80%a7%e8%83%bd%e7%9a%84%e5%bd%b1%e9%9f%bf-WmsPIWUPan\">\u7d22\u5f15\u5c0d\u6027\u80fd\u7684\u5f71\u97ff<\/h2>\n<p>\u7d22\u5f15\u7684\u4f7f\u7528\u5c0dSQL Server\u7684\u6027\u80fd\u6709\u8457\u6df1\u9060\u7684\u5f71\u97ff\u3002\u9069\u7576\u7684\u7d22\u5f15\u53ef\u4ee5\u986f\u8457\u63d0\u9ad8\u67e5\u8a62\u901f\u5ea6\uff0c\u4f46\u4e0d\u7576\u7684\u7d22\u5f15\u5247\u53ef\u80fd\u5c0e\u81f4\u6027\u80fd\u4e0b\u964d\u3002<\/p>\n<h3 id=\"%e6%9f%a5%e8%a9%a2%e6%80%a7%e8%83%bd%e7%9a%84%e6%8f%90%e5%8d%87-WmsPIWUPan\">\u67e5\u8a62\u6027\u80fd\u7684\u63d0\u5347<\/h3>\n<p>\u7576\u67e5\u8a62\u57f7\u884c\u6642\uff0cSQL Server\u6703\u4f7f\u7528\u7d22\u5f15\u4f86\u5feb\u901f\u5b9a\u4f4d\u6240\u9700\u7684\u8cc7\u6599\u3002\u4f8b\u5982\uff0c\u8003\u616e\u4ee5\u4e0b\u67e5\u8a62\uff1a<\/p>\n<pre><code>SELECT * FROM Customers WHERE LastName = 'Smith';<\/code><\/pre>\n<p>\u5982\u679c\u5728LastName\u5217\u4e0a\u5efa\u7acb\u4e86\u975e\u805a\u96c6\u7d22\u5f15\uff0cSQL Server\u53ef\u4ee5\u76f4\u63a5\u901a\u904e\u7d22\u5f15\u627e\u5230\u6240\u6709\u59d3Smith\u7684\u5ba2\u6236\uff0c\u800c\u4e0d\u5fc5\u6383\u63cf\u6574\u500bCustomers\u8868\uff0c\u9019\u6a23\u53ef\u4ee5\u5927\u5e45\u5ea6\u63d0\u9ad8\u67e5\u8a62\u6548\u7387\u3002<\/p>\n<h3 id=\"%e7%b4%a2%e5%bc%95%e7%9a%84%e6%88%90%e6%9c%ac-WmsPIWUPan\">\u7d22\u5f15\u7684\u6210\u672c<\/h3>\n<p>\u5118\u7ba1\u7d22\u5f15\u80fd\u5920\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\uff0c\u4f46\u5b83\u5011\u4e5f\u6703\u5e36\u4f86\u4e00\u4e9b\u6210\u672c\uff1a<\/p>\n<ul>\n<li>\u5b58\u5132\u6210\u672c\uff1a\u6bcf\u500b\u7d22\u5f15\u90fd\u9700\u8981\u984d\u5916\u7684\u5b58\u5132\u7a7a\u9593\u3002<\/li>\n<li>\u7dad\u8b77\u6210\u672c\uff1a\u5728\u63d2\u5165\u3001\u66f4\u65b0\u6216\u522a\u9664\u8cc7\u6599\u6642\uff0c\u7d22\u5f15\u4e5f\u9700\u8981\u88ab\u66f4\u65b0\uff0c\u9019\u6703\u5f71\u97ff\u6027\u80fd\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%9c%80%e4%bd%b3%e5%af%a6%e8%b8%90-WmsPIWUPan\">\u6700\u4f73\u5be6\u8e10<\/h2>\n<p>\u70ba\u4e86\u6700\u5927\u5316\u7d22\u5f15\u7684\u6548\u76ca\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6700\u4f73\u5be6\u8e10\uff1a<\/p>\n<ul>\n<li>\u5b9a\u671f\u5206\u6790\u67e5\u8a62\u6027\u80fd\uff0c\u627e\u51fa\u9700\u8981\u7d22\u5f15\u7684\u5217\u3002<\/li>\n<li>\u907f\u514d\u5728\u7d93\u5e38\u8b8a\u66f4\u7684\u5217\u4e0a\u5efa\u7acb\u7d22\u5f15\uff0c\u4ee5\u6e1b\u5c11\u7dad\u8b77\u6210\u672c\u3002<\/li>\n<li>\u4f7f\u7528SQL Server\u7684\u52d5\u614b\u7ba1\u7406\u8996\u5716\uff08DMV\uff09\u4f86\u76e3\u63a7\u7d22\u5f15\u7684\u4f7f\u7528\u60c5\u6cc1\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-WmsPIWUPan\">\u7e3d\u7d50<\/h2>\n<p>SQL Server\u4e2d\u7684\u7d22\u5f15\u662f\u63d0\u5347\u67e5\u8a62\u6027\u80fd\u7684\u91cd\u8981\u5de5\u5177\u3002\u900f\u904e\u5408\u7406\u7684\u7d22\u5f15\u8a2d\u8a08\uff0c\u53ef\u4ee5\u986f\u8457\u63d0\u9ad8\u8cc7\u6599\u6aa2\u7d22\u7684\u6548\u7387\u3002\u7136\u800c\uff0c\u4f7f\u7528\u7d22\u5f15\u4e5f\u9700\u8981\u8003\u616e\u5230\u5b58\u5132\u548c\u7dad\u8b77\u7684\u6210\u672c\u3002\u4e86\u89e3\u4e0d\u540c\u985e\u578b\u7684\u7d22\u5f15\u53ca\u5176\u7279\u6027\uff0c\u4e26\u6839\u64da\u5be6\u969b\u9700\u6c42\u9032\u884c\u512a\u5316\uff0c\u5c07\u6709\u52a9\u65bc\u63d0\u5347\u6574\u9ad4\u7cfb\u7d71\u7684\u6027\u80fd\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684\u89e3\u6c7a\u65b9\u6848\u4f86\u7ba1\u7406\u60a8\u7684\u8cc7\u6599\u5eab\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u6216<a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a>\u4f86\u652f\u6301\u60a8\u7684\u696d\u52d9\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3SQL Server\u7d22\u5f15\u7684\u7a2e\u985e\u53ca\u5176\u5c0d\u67e5\u8a62\u6027\u80fd\u7684\u5f71\u97ff\uff0c\u63d0\u5347\u6578\u64da\u6aa2\u7d22\u6548\u7387\uff0c\u512a\u5316\u6578\u64da\u5eab\u6027\u80fd\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-140286","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/140286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=140286"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/140286\/revisions"}],"predecessor-version":[{"id":140287,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/140286\/revisions\/140287"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=140286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=140286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=140286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}