Extracting a String From Between Two Delimiting Characters

  • Comments posted to this topic are about the content posted at http://www.sqlservercent

  • I got error from 'SUSTRING' is not a recognized function name.

  • I got error from 'SUSTRING' is not a recognized function name.

  • Try "Substring"

  • Hi, I have a similar issue where i need to extract the data from the xml string which is present in a particular column. I need to get the result set in a way that it should pull everything between <credittaker> </credittaker> from the whole xml string. the length between this is not fixed.

    For e.g. I have a table 'EventHistory' and column 'XMLDataValue' and column data is like given below:

    <event><credittaker>HAROLD D JORDAN</credittaker><primarymonitoringparty>Russell Pleasants</primarymonitoringparty><monitoringentity></monitoringentity><primarygci>510211006</primarygci><status>Pending Initial Setup</status><active>A</active><schedulecomplete>N</schedulecomplete><author>LEAP</author><eventdatetime>Jul 4 2002 8:48AM </eventdatetime><EventCode>Credit Taker Setup Incomplete</EventCode></event>

    <event><credittaker>JORDAN HOLMAN LUMBER CO INC</credittaker><primarymonitoringparty>Susan Jones</primarymonitoringparty><monitoringentity></monitoringentity><primarygci>510156755</primarygci><status>Pending Initial Setup</status><active>A</active><schedulecomplete>N</schedulecomplete><author>LEAP</author><eventdatetime>Jul 4 2002 8:48AM </eventdatetime><EventCode>Credit Taker Setup Incomplete</EventCode></event>

    The result set should give me

    HAROLD D JORDAN

    JORDAN HOLMAN LUMBER CO INC

    from the above xml string.

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

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