• Dwain.c,

    Thank you for your input and advice. This is indeed how I would like the final output to look. However, I need the groupId to populate automatically based on the column value of groupId

    For instance, in this case, the groupId is indeed 206, but for the next record it could be 207, or 999, or anything.

    My desired results should be a little clearer from the previous post I made to Sean.

    dwain.c (1/8/2013)


    How about something simple like this?

    DECLARE @layerXMLData VARCHAR(8000) =

    '<polygon points=''-104.80,31.57 -104.80,31.59 -104.79,31.59 -104.79,31.57 '' id=''MT-209'' />

    <polygon points=''-104.79,31.59 -104.79,31.60 -104.77,31.60 -104.77,31.59 '' id=''MT-209'' />'

    SELECT REPLACE(@layerXMLData, '/>', 'groupid=''206''/>')