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

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

    <bdo id='QvIxg'></bdo><ul id='QvIxg'></ul>
<tfoot id='QvIxg'></tfoot>

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

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

    1. 在 SQL Server XML 處理中為 modify() 參數(shù)化 XPath

      Parameterizing XPath for modify() in SQL Server XML Processing(在 SQL Server XML 處理中為 modify() 參數(shù)化 XPath)

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

        • <tfoot id='ZBs0C'></tfoot>
        • <small id='ZBs0C'></small><noframes id='ZBs0C'>

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

              <legend id='ZBs0C'><style id='ZBs0C'><dir id='ZBs0C'><q id='ZBs0C'></q></dir></style></legend>
                <tbody id='ZBs0C'></tbody>
                本文介紹了在 SQL Server XML 處理中為 modify() 參數(shù)化 XPath的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                限時送ChatGPT賬號..

                正如標(biāo)題所暗示的那樣,我正在嘗試為 SQL Server 中 XML 數(shù)據(jù)列的 modify() 方法參數(shù)化 XPath,但遇到了一些問題.

                Just like the title suggests, I'm trying to parameterize the XPath for a modify() method for an XML data column in SQL Server, but running into some problems.

                到目前為止我有:

                DECLARE @newVal varchar(50)
                DECLARE @xmlQuery varchar(50)
                SELECT @newVal = 'features'
                SELECT @xmlQuery = 'settings/resources/type/text()'
                
                UPDATE  [dbo].[Users]
                SET     [SettingsXml].modify('
                    replace value of (sql:variable("@xmlQuery"))[1]
                    with sql:variable("@newVal")')
                WHERE   UserId = 1
                

                具有以下 XML 結(jié)構(gòu):

                with the following XML Structure:

                <settings>
                    ...
                    <resources>
                        <type> ... </type>
                        ...
                    </resources>
                    ...
                </settings>
                

                然后產(chǎn)生這個錯誤:

                XQuery [dbo.Users.NewSettingsXml.modify()]:'replace'的目標(biāo)最多只能是一個節(jié)點,找到'xs:string ?'

                現(xiàn)在我意識到修改方法一定不能接受字符串作為路徑,但是有沒有辦法不使用動態(tài) SQL 來實現(xiàn)這一點?

                Now I realize that the modify method must not be capable of accepting a string as a path, but is there a way to accomplish this short of using dynamic SQL?

                哦,順便說一下,我使用的是 64 位 SQL Server 2008 Standard,但我編寫的任何查詢都需要與 2005 Standard 兼容.

                Oh, by the way, I'm using SQL Server 2008 Standard 64-bit, but any queries I write need to be compatible back to 2005 Standard.

                謝謝!

                推薦答案

                如果有人感興趣,我自己使用動態(tài)查詢想出了一個相當(dāng)不錯的解決方案:

                In case anyone was interested, I came up with a pretty decent solution myself using a dynamic query:

                DECLARE @newVal nvarchar(max)
                DECLARE @xmlQuery nvarchar(max)
                DECLARE @id int
                
                SET @newVal = 'foo'
                SET @xmlQuery = '/root/node/leaf/text()'
                SET @id = 1
                
                DECLARE @query nvarchar(max)
                
                SET @query = '
                    UPDATE  [Table]
                    SET     [XmlColumn].modify(''
                        replace value of (' + @xmlQuery + '))[1]
                        with sql:variable("@newVal")'')
                    WHERE Id = @id'
                
                EXEC sp_executesql @query,
                                   N'@newVal nvarchar(max) @id int',
                                   @newVal, @id
                

                使用它,動態(tài)查詢中唯一不安全的部分是 xPath,就我而言,它完全由我的代碼控制,因此不應(yīng)被利用.

                Using this, the only unsafe part of the dynamic query is the xPath, which, in my case, is controlled entirely by my code and so shouldn't be exploitable.

                這篇關(guān)于在 SQL Server XML 處理中為 modify() 參數(shù)化 XPath的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數(shù)據(jù)庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發(fā)
                How to create a login to a SQL Server instance?(如何創(chuàng)建對 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()?(為什么會出現(xiàn)“數(shù)據(jù)類型轉(zhuǎn)換錯誤?使用 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 應(yīng)用程序設(shè)計——將文檔從 SQL Server 移動到文件存儲)
                <i id='jLeBh'><tr id='jLeBh'><dt id='jLeBh'><q id='jLeBh'><span id='jLeBh'><b id='jLeBh'><form id='jLeBh'><ins id='jLeBh'></ins><ul id='jLeBh'></ul><sub id='jLeBh'></sub></form><legend id='jLeBh'></legend><bdo id='jLeBh'><pre id='jLeBh'><center id='jLeBh'></center></pre></bdo></b><th id='jLeBh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='jLeBh'><tfoot id='jLeBh'></tfoot><dl id='jLeBh'><fieldset id='jLeBh'></fieldset></dl></div>
              • <tfoot id='jLeBh'></tfoot>
                  <legend id='jLeBh'><style id='jLeBh'><dir id='jLeBh'><q id='jLeBh'></q></dir></style></legend>

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

                    <tbody id='jLeBh'></tbody>
                    • <bdo id='jLeBh'></bdo><ul id='jLeBh'></ul>
                          主站蜘蛛池模板: 亚洲 中文 欧美 日韩 在线观看 | 啪啪毛片 | 嫩草一区二区三区 | а天堂中文最新一区二区三区 | 91性高湖久久久久久久久_久久99 | 天色综合网 | 欧美一区二区在线 | 红色av社区 | 在线看91| 欧美成人影院在线 | 午夜伦4480yy私人影院 | 天天天操天天天干 | 自拍视频在线观看 | 91网站在线观看视频 | 日韩精品免费在线 | 亚洲一区二区网站 | 一区不卡在线观看 | 国产精品久久久久久一区二区三区 | 视频一区在线观看 | 一二三区av | h肉视频 | 国产精品美女久久久久久免费 | 天天综合亚洲 | 国产成年人小视频 | 成人在线视频一区 | 黑人巨大精品欧美一区二区免费 | 91激情电影| 国产精品成人一区二区三区夜夜夜 | 久久精品视频99 | 在线视频中文字幕 | 国产激情一区二区三区 | 午夜精品久久久 | 黄色一级在线播放 | 国产精品久久久久久久免费观看 | 九九久久精品 | 欧美一区二区三区在线观看 | 久久久久一区 | 国产成人精品一区二区三区在线 | www.com久久久 | 成人免费福利视频 | 一区二区亚洲 |