Add to xml stored in sql 2005

megamoy95

New Member
I have a SQL Server 2005 database which has a table called improvements.Within Improvements is a field called TransactionID and one called Comments. The field Comments is a XML data type with such entries as follows.\[code\]<Comment> <CreatedBy>Bob</CreatedBy> <CreatedDateTime>2009-08-24T11:36:13.020774+01:00</CreatedDateTime> <CreaterRole>Manager</CreaterRole> <CreationStage>INITIAL REVIEW</CreationStage> <CreationStatus>APPROVED</CreationStatus> <UserComment>Approved</UserComment></Comment><Comment> <CreatedBy>Bob</CreatedBy> <CreatedDateTime>2009-08-24T11:36:25.7240616+01:00</CreatedDateTime> <CreaterRole>Manager</CreaterRole> <CreationStage>CAPTURE</CreationStage> <CreationStatus>ACCEPTED</CreationStatus> <UserComment /></Comment>\[/code\]I need to enter an additional entry along the lines of:\[code\] <Comment> <CreatedBy>Bob</CreatedBy> <CreatedDateTime>2013-01-29T11:36:25.7240616+01:00</CreatedDateTime> <CreaterRole>Manager</CreaterRole> <CreationStage>CLOSED</CreationStage> <CreationStatus>CLOSED</CreationStatus> <UserComment>Closed as agreed<UserComment /> </Comment>\[/code\]Where the TransactionID = A transaction number.I have found a number of solutions on the internet to amend an entry using SET..... but cannot figure out how to actually add an entry.Can anyone help me with this one please?Many thanks in advance.Kev.
 
Back
Top