Select ALL the text from a text data type

  • Would it help to convert it to xml instead of dealing with the text data type (which is deprecated anyway, so you should consider using xml or varchar() instead...)

    Declare @ID Int

    -- Batch Print version (DL)

    Set@ID = 46633086

    Selectcast(CorrespondenceFO as xml) From IARTS..CorrespondenceLog Where CorrespondenceLogID = @ID



    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]

  • Thanks Lutz.

    I tried that and got this as an error:

    Msg 9402, Level 16, State 1, Line 20

    XML parsing: line 1, character 39, unable to switch the encoding

    Is it because this is xslfo, not strictly xml?

    Here's the first chunk of data in the field:

    <?xml version="1.0" encoding="utf-16"?><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"><fo:layout-master-set><fo:simple-page-master page-height="11in" page-width="8.5in" margin-top="0.50in" margin-left="0.8in" margin-right="0.8in" margin-bottom="0.25in" master-name="PageMaster">

    Looks like it's failing at the start of the first namespace declaration tag...

  • There we go! It looks like this worked:

    Set @ID = 46633086

    Select cast(Cast(CorrespondenceFO as ntext) as xml) From IARTS..CorrespondenceLog Where CorrespondenceLogID = @ID

    Thanks Lutz!!!

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

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