久久久久久久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'>

                            主站蜘蛛池模板: 亚洲精品久久久久久久久久久久久 | 伊人网伊人 | 日韩精品av一区二区三区 | 不卡一区 | 成人免费区一区二区三区 | 毛片a区| 午夜丰满少妇一级毛片 | 国产精品久久久久免费 | 亚洲免费视频网址 | 久久久国产精品一区 | 一级aaaa毛片 | 成人精品国产免费网站 | 日韩在线三级 | 国产精品久久久久久福利一牛影视 | 国产精品69毛片高清亚洲 | a级网站| 国产日韩欧美 | 国产精品一区二区在线播放 | 最新国产精品精品视频 | 91超碰在线观看 | 日韩三极 | 伊人看片 | 色婷婷综合久久久中文字幕 | 亚洲欧洲日韩 | 99精品视频在线观看免费播放 | 亚洲国产欧美日韩 | 日韩高清一区 | www.成人在线视频 | 国产免费拔擦拔擦8x高清 | 国产精品久久久久久久久久免费看 | 每日更新av| 中文字幕一区二区三区四区 | www.99精品| 久草综合在线视频 | 成人久久一区 | 亚洲伊人久久综合 | 亚av在线 | 黄网站免费在线 | 日本人爽p大片免费看 | 97色在线视频 | 91综合网 |