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

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

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

      1. 使用 Xquery 在 sql server 中查詢 XML 列表

        querying an XML list in sql server using Xquery(使用 Xquery 在 sql server 中查詢 XML 列表)
        <tfoot id='u0ADK'></tfoot>
      2. <small id='u0ADK'></small><noframes id='u0ADK'>

                <tbody id='u0ADK'></tbody>

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

                  <legend id='u0ADK'><style id='u0ADK'><dir id='u0ADK'><q id='u0ADK'></q></dir></style></legend>
                  本文介紹了使用 Xquery 在 sql server 中查詢 XML 列表的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我在 SQL Server 中有一個表,用于存儲提交的表單數據.每次提交的表單字段都是動態的,因此收集的數據作為名稱值對存儲在名為 [formdata] 的 XML 數據列中,如下例所示...

                  I have a table in SQL server that is used to store submitted form data. The form fields for each submission are dynamic so the collected data is stored as name value pairs in an XML data column called [formdata] as in the example below...

                  這可以很好地收集所需的信息,但我現在需要將這些數據呈現到平面文件或 Excel 文檔中以供工作人員處理,我想知道使用 Xquery 的最佳方法是什么,以便數據可讀嗎?

                  This works fine for collecting the required information but I now need to render this data to a flat file or an excel document for processing by human staff members and im wondering what the best way of doing this would be using Xquery so that the data is readable?

                  表格如下...

                  [id], [user_id], [datestamp], [formdata]
                  

                  以及 formdata 的示例值

                  And a sample value for formdata

                  <formfields>
                    <item>
                      <itemKey>USER_NAME</itemKey>
                      <itemValue>test</itemValue>
                    </item>
                    <item>
                      <itemKey>value2</itemKey>
                      <itemValue>test</itemValue>
                    </item>
                    <item>
                      <itemKey>MYID</itemKey>
                      <itemValue>5468512</itemValue>
                    </item>
                    <item>
                      <itemKey>testcheckbox</itemKey>
                      <itemValue>item1,item3</itemValue>
                    </item>
                    <item>
                      <itemKey>samplevalue</itemKey>
                      <itemValue>item3</itemValue>
                    </item>
                    <item>
                      <itemKey>accept_terms</itemKey>
                      <itemValue>True</itemValue>
                    </item>
                  </formfields>
                  

                  推薦答案

                  這是您想要的嗎?

                  select
                    id,
                    [user_id],
                    datestamp,
                    f.i.value('itemKey[1]', 'varchar(50)') as itemKey,
                    f.i.value('itemValue[1]', 'varchar(50)') as itemValue
                  from YourTable as T
                    cross apply T.formdata.nodes('/formfields/item') as f(i)
                  

                  測試:

                  declare @T table
                  (
                    id int,
                    user_id int,
                    datestamp datetime,
                    formdata xml
                  )
                  
                  insert into @T (id, user_id, datestamp, formdata)
                  values (1, 1, getdate(),
                  '<formfields>
                    <item>
                      <itemKey>USER_NAME</itemKey>
                      <itemValue>test</itemValue>
                    </item>
                    <item>
                      <itemKey>value2</itemKey>
                      <itemValue>test</itemValue>
                    </item>
                    <item>
                      <itemKey>MYID</itemKey>
                      <itemValue>5468512</itemValue>
                    </item>
                    <item>
                      <itemKey>testcheckbox</itemKey>
                      <itemValue>item1,item3</itemValue>
                    </item>
                    <item>
                      <itemKey>samplevalue</itemKey>
                      <itemValue>item3</itemValue>
                    </item>
                    <item>
                      <itemKey>accept_terms</itemKey>
                      <itemValue>True</itemValue>
                    </item>
                  </formfields>
                  '
                  )
                  
                  select
                    id,
                    [user_id],
                    datestamp,
                    f.i.value('itemKey[1]', 'varchar(50)') as itemKey,
                    f.i.value('itemValue[1]', 'varchar(50)') as itemValue
                  from @T as T
                    cross apply T.formdata.nodes('/formfields/item') as f(i)
                  

                  結果:

                  id  user_id  datestamp                itemKey       itemValue
                  1   1        2011-05-23 15:38:55.673  USER_NAME     test
                  1   1        2011-05-23 15:38:55.673  value2        test
                  1   1        2011-05-23 15:38:55.673  MYID          5468512
                  1   1        2011-05-23 15:38:55.673  testcheckbox  item1,item3
                  1   1        2011-05-23 15:38:55.673  samplevalue   item3
                  1   1        2011-05-23 15:38:55.673  accept_terms  True
                  

                  這篇關于使用 Xquery 在 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 移動到文件存儲)

                  <tfoot id='SQFXr'></tfoot>
                • <legend id='SQFXr'><style id='SQFXr'><dir id='SQFXr'><q id='SQFXr'></q></dir></style></legend>

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

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

                            主站蜘蛛池模板: 毛片入口 | 国产在线精品一区二区三区 | 国产激情视频在线免费观看 | 日韩三区 | 天堂成人国产精品一区 | av永久| 中文字幕免费在线 | 请别相信他免费喜剧电影在线观看 | 成年人黄色免费视频 | 成人日韩精品 | 香蕉久久久 | 久久国产精品视频 | 天堂在线1 | 欧美free性| 欧美日韩精品一区 | 欧美一级特黄aaa大片在线观看 | 国产91丝袜 | 成人久久久久 | 久久精品视频91 | 国产精品久久视频 | 亚洲欧美日韩精品久久亚洲区 | 欧美另类视频 | 中文一区 | 天堂一区二区三区四区 | 国产精品久久久久久妇女 | 在线观看av网站永久 | 精品国产乱码久久久久久蜜臀 | 狠狠色网 | 亚洲成人av在线播放 | 一级a性色生活片久久毛片波多野 | www.国产| 国产精品高潮呻吟久久 | 伊人焦久影院 | 国产一区二区精品在线 | 成人水多啪啪片 | 欧美一区二区三区视频 | 狠狠干五月天 | 在线观看视频福利 | 久久大全 | 日韩中文字幕一区二区三区 | 毛片网站免费观看 |