extract string as xml

  • I have a log table that is used to store some xml as a string (third party so no control over the datatype)

    The string consists of a few description characters foloowed by a colon then the xml

    How can i extract the xml (string) after the colon and return it as actual XML not a string

  • first things that come to mind (without seeing any example code to go on) is using SUBSTRING and/or FOR XML

    read up on them both, unless someone is kind enough to create some test data for you then create a solution too 🙂

    [font="Times New Roman"]There's no kill switch on awesome![/font]
  • I guess you need a split function.

    Be careful with big input data: the split function handles 8000 characters at most.

    Another possibility is using CHARINDEX to find the colon and SUBSTRING/RIGHT to extract the XML part.

    -- Gianluca Sartori

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

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