May 18, 2009 at 6:11 am
HI,
I'm having a problem trying to get a value from a table to be output as an XML Element without a start tag.
The code I am using is this, with the result set below...
select RequestStatus as "retainedDataMessage/retainedDataPay/statusMessage/StatusResponse/requestStatus"
FROM ##StatusUpdates
FOR XML PATH('')
Result Set
The problem I have is that I would like the invalidReq to be within it's own element (but without a start tag). So I would like it to look like the below..
May 19, 2009 at 9:02 am
You could try this:
select '' as "retainedDataMessage/retainedDataPay/statusMessage/StatusResponse/requestStatus/InvalidReq"
FROM ##StatusUpdates
where RequestStatus = 'InvalidReq'
FOR XML PATH('')
There probably is a far better way to do it though, so keep the question open 😀
May 20, 2009 at 2:57 am
Thank you! That solved my problem. Will leave the question open incase anyone has other idea's.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply