pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="7vxrld5" 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="5jbxx77" 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="hxznxhf" 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>
                          • 主站蜘蛛池模板: 【同风运车官网】一站式汽车托运服务平台,验车满意再付款 | 小区健身器材_户外健身器材_室外健身器材_公园健身路径-沧州浩然体育器材有限公司 | 蜘蛛车-登高车-高空作业平台-高空作业车-曲臂剪叉式升降机租赁-重庆海克斯公司 | 篮球架_乒乓球台_足球门_校园_竞技体育器材_厂家_价格-沧州浩然体育器材有限公司 | 活性炭-果壳木质煤质柱状粉状蜂窝活性炭厂家价格多少钱 | 中红外QCL激光器-其他连续-半导体连续激光器-筱晓光子 | 雨水收集系统厂家-雨水收集利用-模块雨水收集池-徐州博智环保科技有限公司 | HV全空气系统_杭州暖通公司—杭州斯培尔冷暖设备有限公司 | 建筑工程资质合作-工程资质加盟分公司-建筑资质加盟 | 百度网站优化,关键词排名,SEO优化-搜索引擎营销推广 | 钢绞线万能材料试验机-全自动恒应力两用机-混凝土恒应力压力试验机-北京科达京威科技发展有限公司 | 菲希尔FISCHER测厚仪-铁素体检测仪-上海吉馨实业发展有限公司 | nalgene洗瓶,nalgene量筒,nalgene窄口瓶,nalgene放水口大瓶,浙江省nalgene代理-杭州雷琪实验器材有限公司 | 盘煤仪,盘料仪,盘点仪,堆料测量仪,便携式激光盘煤仪-中科航宇(北京)自动化工程技术有限公司 | 武汉EPS线条_EPS装饰线条_EPS构件_湖北博欧EPS线条厂家 | 袋式过滤器,自清洗过滤器,保安过滤器,篮式过滤器,气体过滤器,全自动过滤器,反冲洗过滤器,管道过滤器,无锡驰业环保科技有限公司 | 口臭的治疗方法,口臭怎么办,怎么除口臭,口臭的原因-口臭治疗网 | 隆众资讯-首页_大宗商品资讯_价格走势_市场行情 | 冲锋衣滑雪服厂家-冲锋衣定制工厂-滑雪服加工厂-广东睿牛户外(S-GERT) | 钢绞线万能材料试验机-全自动恒应力两用机-混凝土恒应力压力试验机-北京科达京威科技发展有限公司 | 游泳池设计|设备|配件|药品|吸污机-东莞市太平洋康体设施有限公司 | 渣土车电机,太阳能跟踪器电机,蜗轮蜗杆减速电机厂家-淄博传强电机 | 山东彩钢板房,山东彩钢活动房,临沂彩钢房-临沂市贵通钢结构工程有限公司 | ph计,实验室ph计,台式ph计,实验室酸度计,台式酸度计 | 浴室柜-浴室镜厂家-YINAISI · 意大利设计师品牌 | 咿耐斯 |-浙江台州市丰源卫浴有限公司 | 龙门加工中心-数控龙门加工中心厂家价格-山东海特数控机床有限公司_龙门加工中心-数控龙门加工中心厂家价格-山东海特数控机床有限公司 | 模具ERP_模具管理系统_模具mes_模具进度管理_东莞市精纬软件有限公司 | 懂研帝_专业SCI论文润色机构_SCI投稿发表服务公司 | 广州展览制作|展台制作工厂|展览设计制作|展览展示制作|搭建制作公司 | 转子泵_凸轮泵_凸轮转子泵厂家-青岛罗德通用机械设备有限公司 | 高温链条油|高温润滑脂|轴承润滑脂|机器人保养用油|干膜润滑剂-东莞卓越化学 | 硬齿面减速机_厂家-山东安吉富传动设备股份有限公司 | 标准光源箱|对色灯箱|色差仪|光泽度仪|涂层测厚仪_HRC大品牌生产厂家 | 板框压滤机-隔膜压滤机配件生产厂家-陕西华星佳洋装备制造有限公司 | 小型UV打印机-UV平板打印机-大型uv打印机-UV打印机源头厂家 |松普集团 | 国标白水泥,高标号白水泥,白水泥厂家-淄博华雪建材有限公司 | 充气膜专家-气膜馆-PTFE膜结构-ETFE膜结构-商业街膜结构-奥克金鼎 | 四川成都干燥设备_回转筒干燥机_脉冲除尘器_输送设备_热风炉_成都川工星科机电设备有限公司 | 小学教案模板_中学教师优秀教案_高中教学设计模板_教育巴巴 | 无线联网门锁|校园联网门锁|学校智能门锁|公租房智能门锁|保障房管理系统-KEENZY中科易安 | 无锡网站建设-做网站-建网站-网页设计制作-阿凡达建站公司 |