Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL Server How to add and update element in xml data in table based on match found after search using xquery

SQL Server How to add and update element in xml data in table based on match found after search using xquery

Scheduled Pinned Locked Moved Database
databasesql-serversysadminsalesregex
1 Posts 1 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mou_kol
    wrote on last edited by
    #1

    My objective is to add and update data into xml element which store in table. i am weak in xquery to do it. so looking for help. in my table each row has one field which store xml. suppose my xml data look like below one which store in my table

      Consensus Model
      2010 FY
      TRIN
      
      
      Total Sales
      
      NO
    
    Consensus Model
      2011 FY
      TRIN
      
      
      Total Sales
      
      NO
    

    now i have to update XFundCode in all records of xml data if my supplied TabName & StandardLineItem match those records. also i have to add one element called ID=55 to each records if my supplied TabName & StandardLineItem match those records in xml data. so i have two task that i have to add one element called ID = 55 to each records of xml data if my TabName & StandardLineItem found in those records of xml data. also i have to update XFundCode element if my TabName & StandardLineItem found in those records of xml data. Please give me xquery code which i can run in sql server to add & update element in xml data. thanks

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups