Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7091791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:13:54+00:00 2026-05-28T08:13:54+00:00

I have a column that stores xml using SQL Server’s Xml data type. Also,

  • 0

I have a column that stores xml using SQL Server’s Xml data type. Also, I have an Xpath query that can select the single node from the xml that I am wanting to remove. So, my question is, is there a way to select all of the xml in the column EXCEPT the single specific node I’m needing to remove? I can select the node I want to remove, but I can’t find a way to remove it from the rest of the xml and leave all the rest intact. If anyone could give me any guidance on how to do this using SQL Server Xml function, it would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:13:55+00:00Added an answer on May 28, 2026 at 8:13 am

    You can do it like this:

    DECLARE @xml XML
    SELECT @xml = YourXmlField
    FROM YourTable
    WHERE ID = 1
    
    SET @xml.modify('delete /Root/A')
    SELECT @xml
    

    So, you need to put the value into an XML variable and use modify to delete the node, giving the appropriate XPath for the node to remove.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MS SQL Server 2008. I have a column of type XML that
I have mysql table that has a column that stores xml as a string.
I have a problem. I have a SQL Server table that stores a bunch
I am using playframework with a legacy SQL Server 2008 database that has data
I have a SQL Server DB table that has a column ReceivedDate defined as
I have the following xml that stores table definations. How can I loop through
Why do I have to SET ARITHABORT ON when using xml in sql server
I'm using SQL Server 2008 R2 and have a simple table with a column
I have a column in an SQL Server 2005 DB which contains an XML
I have an oracle table which has a column that stores XML in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.