• Amy.G (1/11/2011)


    Steve,

    Do you mean I need to go into the file and type in [CDATA[... where all HTML appears?

    Amy

    Well, run this little test:

    declare @xml1 XML, @xml2 XML;

    set @xml1 = '<Content>

    <![CDATA[

    <div id="contentcenter">

    <p>Perform a <b>hardware</b> check with the utility to assure the quality of the system driver, etc., etc.</p>

    </div>

    ]]>

    </Content>';

    set @xml2 = '<Content>

    <div id="contentcenter">

    <p>Perform a <b>hardware</b> check with the utility to assure the quality of the system driver, etc., etc.</p>

    </div>

    </Content>';

    select @xml1, @xml2;

    @xml1 has the <![CDATA[ ... ]]>, and @xml2 doesn't.

    Notice that in @xml2, that all of the HTML has become tokenized. From what I understand about HTML (very little), there are some tokens where the closing token is optional. If you have any of those in the XML file, SQL is probably going to throw an error.

    As is stands, since the HTML is tokenized, it might not get in the way of extracting the data. You'd have to test it to see. Basically, if it can be put into an XML datatype (either variable or table column), then you will probably be able to work with it without having to add the CDATA stuff.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2