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

      <tfoot id='gUSbs'></tfoot>

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

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

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

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

        使用 XQUERY 更新 SQL 服務器 xml 列?

        Update SQL server xml column using XQUERY?(使用 XQUERY 更新 SQL 服務器 xml 列?)

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

        <legend id='PpxzA'><style id='PpxzA'><dir id='PpxzA'><q id='PpxzA'></q></dir></style></legend>
        <tfoot id='PpxzA'></tfoot>

              <tbody id='PpxzA'></tbody>

              <bdo id='PpxzA'></bdo><ul id='PpxzA'></ul>
                  本文介紹了使用 XQUERY 更新 SQL 服務器 xml 列?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我在 XML 列中有一個簡單的 xml

                  I have a simple xml in a XML column

                  <Bands>
                      <Band>
                          <Name>beatles</Name>
                          <Num>4</Num>
                          <Score>5</Score>
                      </Band>
                      <Band>
                          <Name>doors</Name>
                          <Num>4</Num>
                          <Score>3</Score>
                      </Band>
                  </Bands>
                  

                  我已設法用以下內容更新該列:

                  I have managed to update the column with :

                     -----just update the name to the id)----
                     UPDATE tbl1
                     SET [myXml].modify('replace value of (/Bands/Band/Name/text())[1]
                     with sql:column("id")')
                  

                  一切正常.

                  問題 #1

                  如何使用此查詢將值更新為 id+lalala":

                  How can I use this query to udpate the value to id+"lalala":

                     UPDATE tbl1
                     SET [myXml].modify('replace value of (/Bands/Band/Name/text())[1]
                     with sql:column("id") + "lalala"')
                  

                  Error = XQuery [tbl1.myXml.modify()]: '+' 的參數必須是單個數字原始類型

                  問題 #1

                  假設我不想更新第一條記錄 ([1]) ,但我想udpate(與上面相同的更新)只在 得分>4.

                  Let's say I Don't want to update first record ([1]) , But I want to udpate (the same update as above) only where score>4.

                  我當然可以在 xpath 中寫:

                  I can write ofcourse in the xpath :

                  替換(/Bands/Band[Score>4]/Name/text())[1]的值

                  但我不想在 Xpath 中這樣做.是否有使用 Where 子句執行此操作的正常方法?

                  But I dont want to do it in the Xpath. Isn't there a Normal way of doing this with a Where clause ?

                  類似:

                     UPDATE tbl1
                     SET [myXml].modify('replace value of (/Bands/Band/Name/text())[1]
                     with sql:column("id")  where [...score>4...]')
                  

                  這里是在線 sql

                  推薦答案

                  如果你想連接字符串,你應該使用 concat 并且如果 id 在您的情況下是一個整數,您需要將其轉換為 concat 函數中的字符串.

                  If you want to concatenate strings you should use concat and if id in your case is an integer you need to cast it to a string in the concat function.

                  在 where 子句中可以過濾表中要更新的行,不能在 XML 中指定要更新的節點.這必須在 xquery 表達式中完成.但是,您可以在 where 子句中使用 exist 來過濾掉真正需要更新的行.

                  In the where clause you can filter rows of the table to update, you can not specify what nodes to update in the XML. That has to be done in the xquery expression. You can however use exist in the where clause to filter out the rows that really needs the update.

                  update tbl1
                  set myXml.modify('replace value of (/Bands/Band[Score > 4]/Name/text())[1] 
                                      with concat(string(sql:column("id")), "lalalala")')
                  where myXml.exist('/Bands/Band[Score > 4]') = 1
                  

                  這篇關于使用 XQUERY 更新 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 移動到文件存儲)
                  • <bdo id='SLSGR'></bdo><ul id='SLSGR'></ul>

                      1. <tfoot id='SLSGR'></tfoot>
                      2. <legend id='SLSGR'><style id='SLSGR'><dir id='SLSGR'><q id='SLSGR'></q></dir></style></legend>

                          <tbody id='SLSGR'></tbody>

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

                            主站蜘蛛池模板: 久久久久久久久久久成人 | 亚洲日本欧美 | 福利视频一区二区 | 国产一级淫片a直接免费看 免费a网站 | 夜夜夜操 | 免费日韩网站 | 国产在线视频在线观看 | 久久久久久久久中文字幕 | 亚洲成色777777在线观看影院 | 欧美极品视频 | 日韩视频精品在线 | 精品视频一区二区三区在线观看 | 欧美精品一区二区三区一线天视频 | 黄色网址在线播放 | 精精精精xxxx免费视频 | 国产高清一区二区 | 欧美日韩一 | 国产一区二区三区四区 | 亚洲va欧美va天堂v国产综合 | 国产精品一区在线观看 | 国产精品精品 | 久久在线视频 | 国产有码 | 粉嫩一区二区三区四区公司1 | 91麻豆精品一区二区三区 | 欧美一区二区三区的 | 欧美日韩福利 | 综合色站导航 | 日韩成人精品一区二区三区 | 亚洲一区二区免费 | 亚洲永久免费观看 | 国产a区| 午夜视频免费在线观看 | 伊色综合久久之综合久久 | 中文字幕亚洲精品 | 午夜精品久久久久久不卡欧美一级 | 久久伊人精品 | 日本一区二区高清不卡 | www.9191.com | 国产精品亚洲精品 | 国产毛片av |