久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='xQMr2'></tfoot>
  • <legend id='xQMr2'><style id='xQMr2'><dir id='xQMr2'><q id='xQMr2'></q></dir></style></legend>
  • <small id='xQMr2'></small><noframes id='xQMr2'>

  • <i id='xQMr2'><tr id='xQMr2'><dt id='xQMr2'><q id='xQMr2'><span id='xQMr2'><b id='xQMr2'><form id='xQMr2'><ins id='xQMr2'></ins><ul id='xQMr2'></ul><sub id='xQMr2'></sub></form><legend id='xQMr2'></legend><bdo id='xQMr2'><pre id='xQMr2'><center id='xQMr2'></center></pre></bdo></b><th id='xQMr2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xQMr2'><tfoot id='xQMr2'></tfoot><dl id='xQMr2'><fieldset id='xQMr2'></fieldset></dl></div>

          <bdo id='xQMr2'></bdo><ul id='xQMr2'></ul>

        在 T-SQL 中查詢之前將字符串轉換為 XML 數據類型

        Converting a string to XML datatype before querying in T-SQL(在 T-SQL 中查詢之前將字符串轉換為 XML 數據類型)

      1. <small id='MQJAZ'></small><noframes id='MQJAZ'>

          • <bdo id='MQJAZ'></bdo><ul id='MQJAZ'></ul>

              <tbody id='MQJAZ'></tbody>
              <i id='MQJAZ'><tr id='MQJAZ'><dt id='MQJAZ'><q id='MQJAZ'><span id='MQJAZ'><b id='MQJAZ'><form id='MQJAZ'><ins id='MQJAZ'></ins><ul id='MQJAZ'></ul><sub id='MQJAZ'></sub></form><legend id='MQJAZ'></legend><bdo id='MQJAZ'><pre id='MQJAZ'><center id='MQJAZ'></center></pre></bdo></b><th id='MQJAZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='MQJAZ'><tfoot id='MQJAZ'></tfoot><dl id='MQJAZ'><fieldset id='MQJAZ'></fieldset></dl></div>
              <tfoot id='MQJAZ'></tfoot>

                <legend id='MQJAZ'><style id='MQJAZ'><dir id='MQJAZ'><q id='MQJAZ'></q></dir></style></legend>
                • 本文介紹了在 T-SQL 中查詢之前將字符串轉換為 XML 數據類型的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  如何將字符串轉換為 XML 數據類型,以便我可以將數據作為 XML 查詢:

                  How do I convert a string into an XML datatype so that I can query the data as XML:

                  例如(感謝mellamokb the Wise"為此提供了原始 SQL)

                  For example (thanks to "mellamokb the Wise" who provided the original SQL for this)

                  如果 xmlstring 是 XML 類型,則下面的代碼可以正常工作(請參閱 DEMO)

                  The code below works fine if xmlstring is of the type XML (see DEMO)

                  select id, name
                  from Data
                  cross apply (
                    select Destination.value('data(@Name)', 'varchar(50)') as name
                    from [xmlstring].nodes('/Holidays/Summer/Regions/Destinations/Destination') D(Destination)
                  ) Destinations(Name)
                  

                  但是,如果 xmlString 是 varchar 類型,即使我將字符串轉換為 XML,我也會收到錯誤消息 (演示):

                  However, if xmlString is of type varchar I get an error even though I'm converting the string to XML (DEMO):

                  select id, name
                  from Data
                    cross apply (
                    select Destination.value('data(@Name)', 'varchar(50)') as name
                    from CONVERT(xml,[xmlstring]).nodes('/Holidays/Summer/Regions/Destinations/Destination') D(Destination)
                  ) Destinations(Name)
                  

                  推薦答案

                  您可以在一個額外的交叉應用中進行轉換.

                  You can do the cast it in one extra cross apply.

                  select id,
                         T.N.value('@Name', 'varchar(50)') as name
                  from Data
                  cross apply (select cast(xmlstring as xml)) as X(X)
                  cross apply X.X.nodes('/Holidays/Summer/Regions/Destinations/Destination') T(N)
                  

                  SQL 小提琴

                  轉換為 XML 可能存在性能問題.看看這個答案和這個答案

                  There might be performance issues with casting to XML. Have a look at this answer and this answer

                  這篇關于在 T-SQL 中查詢之前將字符串轉換為 XML 數據類型的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數據庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發
                  How to create a login to a SQL Server instance?(如何創建對 SQL Server 實例的登錄?)
                  How to know the version and edition of SQL Server through registry search(如何通過注冊表搜索知道SQL Server的版本和版本)
                  Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會出現“數據類型轉換錯誤?使用 ExecuteNonQuery()?)
                  How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)
                  WinForms application design - moving documents from SQL Server to file storage(WinForms 應用程序設計——將文檔從 SQL Server 移動到文件存儲)

                        <tfoot id='9Bynd'></tfoot>
                      • <small id='9Bynd'></small><noframes id='9Bynd'>

                        <legend id='9Bynd'><style id='9Bynd'><dir id='9Bynd'><q id='9Bynd'></q></dir></style></legend>

                          <tbody id='9Bynd'></tbody>

                          <i id='9Bynd'><tr id='9Bynd'><dt id='9Bynd'><q id='9Bynd'><span id='9Bynd'><b id='9Bynd'><form id='9Bynd'><ins id='9Bynd'></ins><ul id='9Bynd'></ul><sub id='9Bynd'></sub></form><legend id='9Bynd'></legend><bdo id='9Bynd'><pre id='9Bynd'><center id='9Bynd'></center></pre></bdo></b><th id='9Bynd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9Bynd'><tfoot id='9Bynd'></tfoot><dl id='9Bynd'><fieldset id='9Bynd'></fieldset></dl></div>
                            <bdo id='9Bynd'></bdo><ul id='9Bynd'></ul>

                          • 主站蜘蛛池模板: 99免费| 福利av在线 | 日韩在线免费视频 | 一区二区三区小视频 | 一区二区三区亚洲 | 欧美日韩国产一区二区三区 | 久久精品91久久久久久再现 | 伊人伊人 | 亚洲精品日韩在线 | 久热久草| 国产精品国产成人国产三级 | 国产成人精品999在线观看 | 久久精品国产亚洲 | 91xxx在线观看 | 二区av | 欧美大片久久久 | 欧美在线看片 | 亚洲精品国产成人 | 欧美中文一区 | 一区二区日韩 | 欧日韩在线观看 | 一区二区三区欧美 | 国产精品免费一区二区 | 欧美精品二区 | 欧美一级黄色网 | 在线中文字幕av | 欧美久久视频 | 一区二区三区免费 | 久视频在线 | 欧美亚州| 日本三级网站在线 | 视频一区在线观看 | 成人二区| 欧美在线一区二区三区四区 | 国产污视频在线 | 久国产 | 成人h动漫亚洲一区二区 | 污视频免费在线观看 | 美女网站视频免费黄 | 欧美一区二区小视频 | 毛片的网址|