• Hi Buell,

    I think, although your question seems to be answered, if your statement needs to be run dynamically you might want to consider NOT to use EXEC @query, but rather EXEC sp_executesql @query.

    Not only that Microsoft prefer this over EXECUTE, but you'll get a higher probability that execution plans can be reused.

    However, results are the same!

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]