xml retirve

  • declare @FeatureList xml

    set @FeatureList = '

    "true"

    "false"

    "true"

    "false"

    "true"

    "false"

    '

    From this string i want to retrive the data like this

    6a698c85-4e95-4827-87b4-6eb4d74cfbab as featureid

    true Read

    False write

    can anyone pls help

  • The forum does not allow xml unless you use the code="xml" IFCode as you can see in the IFCode shortcut on the left. Please edit your post or put in a new one with the actual XML enclosed in the proper IFCode.

    Thanks,

  • Hi,

    you could use something along those lines:

    SELECT DISTINCT

    c.value('@Id[1]','varchar(30)') AS FeatureID,

    c.value('ReadPermission[1]','varchar(30)') AS ReadPerm,

    c.value('WritePermission[1]','varchar(30)') AS WritePerm

    FROM @FeatureList.nodes('Features/Feature') AS T(c)

    /* result set:

    FeatureIDReadPermWritePerm

    6a698c85-4e95-4827-87b4-6eb4d7"true""false"

    */



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Hey ,

    Thanks a lot...........

Viewing 4 posts - 1 through 3 (of 3 total)

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