{"id":136925,"date":"2024-10-31T11:56:48","date_gmt":"2024-10-31T03:56:48","guid":{"rendered":"https:\/\/server.hk\/cnblog\/136925\/"},"modified":"2024-10-31T11:56:49","modified_gmt":"2024-10-31T03:56:49","slug":"sql-server-2014%e6%96%b0%e7%89%b9%e6%80%a7%e6%8e%a2%e7%a7%981%ef%bc%9a%e5%85%a7%e5%ad%98%e6%95%b8%e6%93%9a%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/136925\/","title":{"rendered":"SQL Server 2014\u65b0\u7279\u6027\u63a2\u79d8(1)\uff1a\u5167\u5b58\u6578\u64da\u5eab"},"content":{"rendered":"<h1 id=\"sql-server-2014%e6%96%b0%e7%89%b9%e6%80%a7%e6%8e%a2%e7%a7%981%ef%bc%9a%e5%85%a7%e5%ad%98%e6%95%b8%e6%93%9a%e5%ba%ab-bCdynpUsWc\">SQL Server 2014\u65b0\u7279\u6027\u63a2\u79d8(1)\uff1a\u5167\u5b58\u6578\u64da\u5eab<\/h1>\n<p>\u96a8\u8457\u6578\u64da\u91cf\u7684\u6fc0\u589e\uff0c\u4f01\u696d\u5c0d\u6578\u64da\u5eab\u7684\u6027\u80fd\u8981\u6c42\u4e5f\u8d8a\u4f86\u8d8a\u9ad8\u3002\u5fae\u8edf\u5728\u5176SQL Server 2014\u7248\u672c\u4e2d\u5f15\u5165\u4e86\u591a\u9805\u65b0\u7279\u6027\uff0c\u5176\u4e2d\u6700\u5f15\u4eba\u6ce8\u76ee\u7684\u4fbf\u662f\u5167\u5b58\u6578\u64da\u5eab\uff08In-Memory OLTP\uff09\u3002\u9019\u4e00\u7279\u6027\u65e8\u5728\u63d0\u5347\u6578\u64da\u8655\u7406\u7684\u901f\u5ea6\u548c\u6548\u7387\uff0c\u7279\u5225\u662f\u5728\u9ad8\u4e26\u767c\u7684\u74b0\u5883\u4e2d\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u5167\u5b58\u6578\u64da\u5eab\u7684\u5de5\u4f5c\u539f\u7406\u3001\u512a\u52e2\u4ee5\u53ca\u5982\u4f55\u5728\u5be6\u969b\u61c9\u7528\u4e2d\u9032\u884c\u914d\u7f6e\u3002<\/p>\n<h2 id=\"%e5%85%a7%e5%ad%98%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e5%b7%a5%e4%bd%9c%e5%8e%9f%e7%90%86-bCdynpUsWc\">\u5167\u5b58\u6578\u64da\u5eab\u7684\u5de5\u4f5c\u539f\u7406<\/h2>\n<p>\u5167\u5b58\u6578\u64da\u5eab\u662fSQL Server 2014\u4e2d\u4e00\u9805\u9769\u547d\u6027\u7684\u6280\u8853\uff0c\u5141\u8a31\u7528\u6236\u5c07\u6574\u500b\u6578\u64da\u8868\u5b58\u5132\u5728\u5167\u5b58\u4e2d\uff0c\u800c\u4e0d\u662f\u50b3\u7d71\u7684\u78c1\u789f\u5b58\u5132\u3002\u9019\u6a23\u7684\u8a2d\u8a08\u4f7f\u5f97\u6578\u64da\u7684\u8b80\u53d6\u548c\u5beb\u5165\u901f\u5ea6\u5927\u5e45\u63d0\u5347\uff0c\u56e0\u70ba\u5167\u5b58\u7684\u8a2a\u554f\u901f\u5ea6\u9060\u5feb\u65bc\u78c1\u789f\u3002<\/p>\n<p>\u5167\u5b58\u6578\u64da\u5eab\u7684\u6838\u5fc3\u7d44\u4ef6\u662f\u201c\u5167\u5b58\u512a\u5316\u8868\u201d\uff08Memory-Optimized Tables\uff09\u548c\u201c\u5167\u5b58\u512a\u5316\u4e8b\u52d9\u201d\uff08Memory-Optimized Transactions\uff09\u3002\u9019\u4e9b\u8868\u548c\u4e8b\u52d9\u5c08\u70ba\u5167\u5b58\u64cd\u4f5c\u800c\u8a2d\u8a08\uff0c\u4e26\u4f7f\u7528\u4e86\u4e0d\u540c\u65bc\u50b3\u7d71\u78c1\u789f\u8868\u7684\u5b58\u5132\u683c\u5f0f\u3002\u5167\u5b58\u512a\u5316\u8868\u4e0d\u652f\u6301\u67d0\u4e9b\u50b3\u7d71\u7684\u6578\u64da\u985e\u578b\u548c\u7d04\u675f\uff0c\u4f46\u5b83\u5011\u7684\u6027\u80fd\u512a\u52e2\u4f7f\u5f97\u9019\u4e9b\u9650\u5236\u5728\u8a31\u591a\u61c9\u7528\u5834\u666f\u4e2d\u662f\u53ef\u4ee5\u63a5\u53d7\u7684\u3002<\/p>\n<h2 id=\"%e5%85%a7%e5%ad%98%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e5%84%aa%e5%8b%a2-bCdynpUsWc\">\u5167\u5b58\u6578\u64da\u5eab\u7684\u512a\u52e2<\/h2>\n<ul>\n<li><strong>\u6027\u80fd\u63d0\u5347\uff1a<\/strong>\u5167\u5b58\u6578\u64da\u5eab\u80fd\u5920\u986f\u8457\u63d0\u9ad8\u6578\u64da\u7684\u8655\u7406\u901f\u5ea6\uff0c\u7279\u5225\u662f\u5728\u9ad8\u4e26\u767c\u7684\u74b0\u5883\u4e2d\u3002\u6839\u64da\u5fae\u8edf\u7684\u6e2c\u8a66\uff0c\u5167\u5b58\u6578\u64da\u5eab\u7684\u6027\u80fd\u53ef\u4ee5\u6bd4\u50b3\u7d71\u78c1\u789f\u6578\u64da\u5eab\u5feb20\u500d\u4ee5\u4e0a\u3002<\/li>\n<li><strong>\u6e1b\u5c11\u5ef6\u9072\uff1a<\/strong>\u7531\u65bc\u6578\u64da\u76f4\u63a5\u5b58\u5132\u5728\u5167\u5b58\u4e2d\uff0c\u8b80\u53d6\u548c\u5beb\u5165\u64cd\u4f5c\u7684\u5ef6\u9072\u5927\u5e45\u964d\u4f4e\uff0c\u9019\u5c0d\u65bc\u9700\u8981\u5373\u6642\u97ff\u61c9\u7684\u61c9\u7528\u5c24\u70ba\u91cd\u8981\u3002<\/li>\n<li><strong>\u7c21\u5316\u7684\u4e8b\u52d9\u8655\u7406\uff1a<\/strong>\u5167\u5b58\u6578\u64da\u5eab\u652f\u6301\u6a02\u89c0\u4e26\u767c\u63a7\u5236\uff0c\u9019\u610f\u5473\u8457\u5728\u4e8b\u52d9\u57f7\u884c\u904e\u7a0b\u4e2d\u4e0d\u9700\u8981\u9396\u5b9a\u8cc7\u6e90\uff0c\u5f9e\u800c\u6e1b\u5c11\u4e86\u6b7b\u9396\u7684\u98a8\u96aa\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae%e5%85%a7%e5%ad%98%e6%95%b8%e6%93%9a%e5%ba%ab-bCdynpUsWc\">\u5982\u4f55\u914d\u7f6e\u5167\u5b58\u6578\u64da\u5eab<\/h2>\n<p>\u8981\u5728SQL Server 2014\u4e2d\u4f7f\u7528\u5167\u5b58\u6578\u64da\u5eab\uff0c\u9996\u5148\u9700\u8981\u5275\u5efa\u5167\u5b58\u512a\u5316\u8868\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5275\u5efa\u4e00\u500b\u5167\u5b58\u512a\u5316\u8868\uff1a<\/p>\n<pre><code>CREATE TABLE dbo.MyMemoryOptimizedTable\n(\n    ID INT NOT NULL PRIMARY KEY NONCLUSTERED,\n    Name NVARCHAR(100) NOT NULL,\n    Quantity INT NOT NULL\n) WITH (MEMORY_OPTIMIZED = ON);<\/code><\/pre>\n<p>\u5728\u5275\u5efa\u5167\u5b58\u512a\u5316\u8868\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u6a19\u6e96\u7684T-SQL\u8a9e\u53e5\u9032\u884c\u6578\u64da\u7684\u63d2\u5165\u3001\u67e5\u8a62\u548c\u66f4\u65b0\u64cd\u4f5c\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5167\u5b58\u512a\u5316\u8868\u4e0d\u652f\u6301\u67d0\u4e9b\u529f\u80fd\uff0c\u4f8b\u5982\u5916\u9375\u7d04\u675f\u548c\u89f8\u767c\u5668\uff0c\u56e0\u6b64\u5728\u8a2d\u8a08\u6578\u64da\u6a21\u578b\u6642\u9700\u8981\u8b39\u614e\u8003\u616e\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-bCdynpUsWc\">\u7d50\u8ad6<\/h2>\n<p>SQL Server 2014\u7684\u5167\u5b58\u6578\u64da\u5eab\u7279\u6027\u70ba\u4f01\u696d\u63d0\u4f9b\u4e86\u4e00\u7a2e\u5168\u65b0\u7684\u6578\u64da\u8655\u7406\u65b9\u5f0f\uff0c\u80fd\u5920\u986f\u8457\u63d0\u5347\u6027\u80fd\u548c\u6548\u7387\u3002\u96a8\u8457\u6578\u64da\u9700\u6c42\u7684\u589e\u9577\uff0c\u5167\u5b58\u6578\u64da\u5eab\u7684\u61c9\u7528\u5834\u666f\u5c07\u6703\u8d8a\u4f86\u8d8a\u5ee3\u6cdb\u3002\u5c0d\u65bc\u5e0c\u671b\u63d0\u5347\u6578\u64da\u8655\u7406\u80fd\u529b\u7684\u4f01\u696d\u4f86\u8aaa\uff0c\u5167\u5b58\u6578\u64da\u5eab\u7121\u7591\u662f\u4e00\u500b\u503c\u5f97\u8003\u616e\u7684\u9078\u64c7\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dcVPS\u548c\u5176\u4ed6\u4f3a\u670d\u5668\u89e3\u6c7a\u65b9\u6848\u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9 <a href=\"https:\/\/server.hk\">Server.HK<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22SQL Server 2014\u7684\u5167\u5b58\u6578\u64da\u5eab\u65b0\u7279\u6027\uff0c\u63d0\u5347\u6027\u80fd\u8207\u6548\u7387\uff0c\u52a9\u529b\u6578\u64da\u8655\u7406\u7684\u9769\u547d\u6027\u8b8a\u9769\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-136925","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/136925","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=136925"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/136925\/revisions"}],"predecessor-version":[{"id":136926,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/136925\/revisions\/136926"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=136925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=136925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=136925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}