Hi all I tried forllowing XQuery and it's working fine DECLARE @Name nvarchar(100)SELECT @Name = 'Calvin'DECLARE @xmldoc xmlSET @xmldoc = '<Root> <Employee EmployeeID="1"> <EmployeeInformation> <FirstName>Scott</FirstName> </EmployeeInformation> </Employee> </Root>'SELECT @xmldocSELECT Employee.col.value('FirstName[1]','VARCHAR(100)') AS FirstNameFROM @xmldoc.nodes('/Root/Employee/EmployeeInformation') Employee(col)SET @xmldoc.modify('replace value of (/Root/Employee/EmployeeInformation/FirstName/text())[1] with sql:variable("@Name")' )SELECT @xmldoc Now I wants to use sql:column() in staid of sql:veriable() something like thisSET @xmldoc.modify('replace value of (/Root/Employee/EmployeeInformation/FirstName/text())[1] with sql:column("pc.FirstName")' )FROM Person.Contact WHERE ContactID =1SELECT @xmldoc This gives me error Any help please Thank You
See these links that might help you: http://www.15seconds.com/issue/050803.htm http://technet.microsoft.com/en-us/library/ms345122.aspx http://technet.microsoft.com/en-us/library/ms191214.aspx
Thanks satya for replay So if I wants to update XML I need to have it to store it some SQL Table Also is their any way i can Update multipal nodes of XML using in one commnd? Thanks