About XML Explicit

  • Hi All,

    I wanted the resulted xml to look like this :

    <Root>

    <QueryWaiting version="B000">

    <Authentication id="57985539">NQIGUTXD</Authentication>

    </QueryWaiting>

    <QueryWaiting version="B000">

    <Authentication id="57985540">FONFSNPX</Authentication>

    </QueryWaiting>

    </Root>

    But the code of mine is not getting exactly. Please do find the code below and let me know the changes :

    SELECT 1 AS Tag,

    NULL AS Parent,

    'B000' AS 'QueryWaiting!1!version' ,

    NULL AS 'Authentication!2!id' ,

    NULL AS 'Authentication!2!'

    Union ALL

    SELECT

    2 as tag,

    1 as parent,

    NULL,

    ControlStationID,

    [Password]

    FROM SW_ControlStations

    FOR XML EXPLICIT ,ROOT('Root')

    Please help me asap

  • Please don't cross post. It just wastes people's time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic1182356-391-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply