• David.Poole (8/31/2010)


    Why not use sp_ExecuteSQL and build up the query that is needed in T-SQL code. This will cache the execution plan for the query statement.

    The other thing I would suggest is that if you are going to using multiple LIKE '%[some string]% then you consider using full text indexes.

    Unfortunately Full Text Indexing doesn't handle middle of a string search like LIKE does.

    It seems to only handle the LIKE 'sometext%' type searches... and not inner text type searches.

    Or at least that's what it did in SQL 2005 and earlier.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]