Searching Text datatype

  • I have a very larre (and growing) table which contains a PK and another column of the type text.

    The text column contains  XML, and I wish to search for the occurance of the various XML tags in the table.

    Currently I can use LIKE statements to pull out matches.  Will I still be able to do this if the XML in the keeps getting longer?

    And would it actually be quicker to use a full-text index or PATINDEX ?

    Thanks!!

  • PATINDEX will return the position of the XML in the row, and if your table contains millions of rows than it will take some time until you get the count.

    Full-text index is great and fast but you will have to take special consideration if the table contains more than 1 million rows, in terms of how often you are going to populate and by using which method (i.e. full population, incremental and so forth). You will have to add a timestamp datatype column in your full-text enabled table to take advantage of incremental population. Check BOL for more details.


    Cheers,

    Digesh

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

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