{"id":229,"date":"2018-06-26T08:03:00","date_gmt":"2018-06-26T00:03:00","guid":{"rendered":"https:\/\/yeslq.com\/201806229.html"},"modified":"2018-06-26T08:03:00","modified_gmt":"2018-06-26T00:03:00","slug":"microsoft-sql-server_26","status":"publish","type":"post","link":"https:\/\/yeslq.com\/?p=229","title":{"rendered":"Microsoft SQL Server\u5254\u9664\u5b57\u6bb5\u4e2d\u7684\u6362\u884c\u7b26"},"content":{"rendered":"<p>\n\u6709\u65f6\u5019\u5728SQL Server\u4e2d\u67e5\u8be2\u5b8c\u7ed3\u679c\uff0c\u5f53\u590d\u5236\u5230excel\u7684\u65f6\u5019\u5076\u5c14\u4f1a\u9047\u5230\u81ea\u52a8\u6362\u884c<\/p>\n<p>\u53d1\u73b0\u95ee\u9898\u96c6\u4e2d\u51fa\u73b0\u5728\u4e24\u4e2a\u5b57\u6bb5\u4e2d\uff0c\u9042\u5c06\u5b57\u6bb5\u91cd\u65b0\u7b5b\u67e5\u4e00\u6b21<\/p>\n<p>SELECT aaa,bbb<br \/>\nFROM&nbsp; table<br \/>\nWHERE&nbsp; CHARINDEX(CHAR(10),aaa) &gt; 0&nbsp; OR CHARINDEX(CHAR(10),bbb) &gt; 0<\/p>\n<p>\u5728\u8868\u4e2d\u67e5\u627e\u8fd9\u4e24\u4e2a\u5b57\u6bb5\u662f\u5426\u5305\u542b\u56de\u8f66\u7b26\uff0c\u5e76\u5c06\u5305\u542b\u56de\u8f66\u7b26\u7684\u5b57\u6bb5\u5185\u5bb9\u7f57\u5217\u51fa\u6765<\/p>\n<p>\u66ff\u6362\u56de\u8f66\u7b26<\/p>\n<p>UPDATE&nbsp; table&nbsp;<br \/>\nSET&nbsp;<br \/>\n&nbsp; &nbsp; &nbsp;aaa = REPLACE(aaa,CHAR(10),&#8221;)<br \/>\n&nbsp; &nbsp;, bbb= REPLACE(bbb,CHAR(10),&#8221;)<br \/>\nWHERE<br \/>\n&nbsp; &nbsp; &nbsp;aaa = aaa1&nbsp; OR&nbsp; &nbsp;bbb = bbb1<\/p>\n<p>\u5c06\u6240\u6709\u56de\u8f66\u7b26\u66ff\u6362\u4e3a\u7a7a\u503c\uff0c\u5373\u5220\u9664\u6389\uff0c\u95ee\u9898\u89e3\u51b3<\/p>\n<p>\u5e38\u89c1\u5b57\u7b26(\u66f4\u591a\u89c1ASCII\u7801\u8868)\uff1a<br \/>\n\u5236\u8868\u7b26\uff1a CHAR(9)<br \/>\n\u6362\u884c\u7b26\uff1a CHAR(10)<br \/>\n\u56de\u8f66\u7b26\uff1a CHAR(13)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u65f6\u5019\u5728SQL Server\u4e2d\u67e5\u8be2\u5b8c\u7ed3\u679c\uff0c\u5f53\u590d\u5236\u5230excel\u7684\u65f6\u5019\u5076\u5c14\u4f1a\u9047\u5230\u81ea\u52a8\u6362\u884c \u53d1\u73b0\u95ee\u9898\u96c6\u4e2d\u51fa\u73b0\u5728\u4e24\u4e2a\u5b57 &#8230; <a title=\"Microsoft SQL Server\u5254\u9664\u5b57\u6bb5\u4e2d\u7684\u6362\u884c\u7b26\" class=\"read-more\" href=\"https:\/\/yeslq.com\/?p=229\" aria-label=\"\u9605\u8bfb Microsoft SQL Server\u5254\u9664\u5b57\u6bb5\u4e2d\u7684\u6362\u884c\u7b26\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[72,69],"class_list":["post-229","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ascii","tag-sql"],"_links":{"self":[{"href":"https:\/\/yeslq.com\/index.php?rest_route=\/wp\/v2\/posts\/229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yeslq.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yeslq.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yeslq.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yeslq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=229"}],"version-history":[{"count":0,"href":"https:\/\/yeslq.com\/index.php?rest_route=\/wp\/v2\/posts\/229\/revisions"}],"wp:attachment":[{"href":"https:\/\/yeslq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yeslq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yeslq.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}