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

  • <tfoot id='EXGHp'></tfoot>

      <small id='EXGHp'></small><noframes id='EXGHp'>

      <legend id='EXGHp'><style id='EXGHp'><dir id='EXGHp'><q id='EXGHp'></q></dir></style></legend>

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

        <i id='EXGHp'><tr id='EXGHp'><dt id='EXGHp'><q id='EXGHp'><span id='EXGHp'><b id='EXGHp'><form id='EXGHp'><ins id='EXGHp'></ins><ul id='EXGHp'></ul><sub id='EXGHp'></sub></form><legend id='EXGHp'></legend><bdo id='EXGHp'><pre id='EXGHp'><center id='EXGHp'></center></pre></bdo></b><th id='EXGHp'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EXGHp'><tfoot id='EXGHp'></tfoot><dl id='EXGHp'><fieldset id='EXGHp'></fieldset></dl></div>
      1. 修改 SQL server 中的 XML 以添加根節點

        Modify XML in SQL server to add a root node(修改 SQL server 中的 XML 以添加根節點)
        • <small id='EPGq5'></small><noframes id='EPGq5'>

              <tbody id='EPGq5'></tbody>

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

                <tfoot id='EPGq5'></tfoot>

                  <legend id='EPGq5'><style id='EPGq5'><dir id='EPGq5'><q id='EPGq5'></q></dir></style></legend>
                  本文介紹了修改 SQL server 中的 XML 以添加根節點的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  為了首先給出這個問題的一些背景,我正在重寫一些當前循環通過一些 xml 的代碼,在每個循環的末尾插入一個表 - 替換為一個接受 xml 參數的 sp 并執行一次性插入,將xml切碎"到一張表中.

                  To give some background to this problem first, I am rewriting some code that currently loops through some xml, doing an insert to a table at the end of each loop - replacing with a single sp that takes an xml parameter and does the insert in one go, 'shredding' the xml into a table.

                  主shred已經成功完成,但目前其中一列用于存儲整個節點.我已經能夠(幾乎)計算出為此所需的查詢,但它錯過了節點的根部分.我得出的結論是,我的查詢盡我所能,我正在尋找一種方法,然后執行更新語句以將根節點恢復到那里.

                  The main shred has been done successfully,but currently one of the columns is used to store the entire node. I have been able to work out the query necessary for this (almost), but it misses out the root part of the node. I have come to the conclusion that my query is as good as I can get it, and I am looking at a way to then do an update statement to get the root node back in there.

                  所以我的 xml 是這樣的;

                  So my xml is of the form;

                  <xml>
                  <Items>
                  <Item>
                      <node1>...</node1><node2>..<node2>.....<noden>...<noden>
                  <Item>
                  <Item>
                      <node1>...</node1><node2>..<node2>.....<noden>...<noden>
                  <Item>
                  <Item>
                      <node1>...</node1><node2>..<node2>.....<noden>...<noden>
                  <Item>
                  ......
                  <Items>
                  </xml>
                  

                  所以基本的粉碎將值從 node1 放入 column1,將 node2 放入 column2 等等.插入語句看起來像;

                  So the basic shredding puts the value from node1 into column1, node2 into column2 etc. The insert statement looks something like;

                  INSERT INTO mytable col1, col2,...etc.....,wholenodecolumn
                  Select  
                  doc.col.value('node1[1]', 'int') column1,
                  doc.col.value('node2[1]', 'varchar(50)') column2,
                  ....etc......,
                  doc.col.query('*')--this is the query for getting the whole node
                  FROM @xml.nodes('//Items/Item') doc(col)
                  

                  在整個節點列中結束的 XML 是以下形式;

                  The XML that ends up in wholenodecolumn is of the form;

                  <node1>...</node1><node2>..<node2>.....<noden>...<noden>
                  

                  但我需要它的形式

                  <Item><node1>...</node1><node2>..<node2>.....<noden>...<noden></Item>
                  

                  現有代碼(很多)依賴于此列中的 xml 格式是否正確.

                  There is existing code (a lot of it) that depends on the xml in this column being of the correct form.

                  那么有人可以看到如何修改 doc.col.query('*') 以獲得所需的結果嗎?

                  So can someone maybe see how to modify the doc.col.query('*') to get the desired result?

                  無論如何,我放棄了修改查詢,并試圖想其他方法來完成最終結果.我現在看到的是插入后的更新 - 類似;

                  Anyway, I gave up on modifying the query, and tried to think of other ways to accomplish the end result. What I am now looking at is an Update after the insert- something like;

                  update mytable set wholenodecolumn.modify('insert <Item> as first before * ')
                  

                  如果我能做到這一點

                   .modify('insert </Item> as last after * ')  
                  

                  那沒問題,但一次做 1 個不是一種選擇,因為 XML 無效

                  that would be fine, but doing 1 at a time isn't an option as the XML is then invalid

                  XQuery [mytable.wholenodecolumn.modify()]: Expected end tag 'Item'  
                  

                  并且兩者一起做我不知道是否可行,但我嘗試了各種語法并且無法開始工作.

                  and doing both together I don't know if it's possible but I've tried various syntax and can't get to work.

                  感謝其他解決問題的方法

                  Any other approaches to the problem also gratefully received

                  推薦答案

                  在這里回答我自己的問題!- 這是對我所說的其他嘗試答案之一的評論:

                  Answering my own question here! - this follows on from the comments to the one of the other attempted answers where I said:

                  我目前正在研究 FLWOR查詢中的 Xquery 構造.
                  col.query('for $item in * return {$item} ') 差不多在那里,但周圍每個節點,而不是圍繞所有節點

                  I am currently looking into FLWOR Xquery constructs in the query.
                  col.query('for $item in * return <Item> {$item} </item>') is almost there, but puts around each node, rather than around all the nodes

                  我已經掌握了語法,一個小小的調整就給了我我需要的東西;

                  I was almost there with the syntax, a small tweak has given me what I needed;

                  doc.col.query('<Item> { for $item in * return $item } </item>'
                  

                  感謝所有提供幫助的人.我現在有進一步的相關問題,但我會作為單獨的問題發布

                  Thankyou to everyone that helped. I have further related issues now but I'll post as separate questions

                  這篇關于修改 SQL server 中的 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 移動到文件存儲)
                  <i id='3nwXu'><tr id='3nwXu'><dt id='3nwXu'><q id='3nwXu'><span id='3nwXu'><b id='3nwXu'><form id='3nwXu'><ins id='3nwXu'></ins><ul id='3nwXu'></ul><sub id='3nwXu'></sub></form><legend id='3nwXu'></legend><bdo id='3nwXu'><pre id='3nwXu'><center id='3nwXu'></center></pre></bdo></b><th id='3nwXu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3nwXu'><tfoot id='3nwXu'></tfoot><dl id='3nwXu'><fieldset id='3nwXu'></fieldset></dl></div>

                    1. <tfoot id='3nwXu'></tfoot>
                        <tbody id='3nwXu'></tbody>

                          <legend id='3nwXu'><style id='3nwXu'><dir id='3nwXu'><q id='3nwXu'></q></dir></style></legend>
                        • <small id='3nwXu'></small><noframes id='3nwXu'>

                            <bdo id='3nwXu'></bdo><ul id='3nwXu'></ul>
                          • 主站蜘蛛池模板: 亚洲成人一二区 | 国产精品免费一区二区三区四区 | 91国内视频在线 | 毛片日韩| 亚洲成人免费av | 欧美国产91 | 真人女人一级毛片免费播放 | 久久99精品久久久97夜夜嗨 | 三级成人在线观看 | 无码日韩精品一区二区免费 | 三级特黄特色视频 | 99久久电影| 一级毛片高清 | 久久久久成人精品免费播放动漫 | 鲁一鲁资源影视 | 亚洲国产二区 | 天天在线操 | 国产偷录叫床高潮录音 | 狠狠婷婷综合久久久久久妖精 | 久久精品99 | 蜜桃精品在线 | 一区二区三区免费 | 99热国产在线播放 | 久在线观看 | 91人人澡人人爽 | 91精品福利 | 精品在线播放 | 国产精品欧美一区二区三区不卡 | 欧洲妇女成人淫片aaa视频 | 国产精品一区二区三区免费观看 | 亚洲一区播放 | 亚洲激情第一页 | 人人种亚洲 | 四虎影视免费在线 | 国产精品不卡 | 欧美日韩大片 | 四色成人av永久网址 | 五月婷婷在线视频 | 中文字幕精品一区二区三区精品 | 在线免费观看毛片 | 国产不卡一 |