http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/
You'll need dynamic SQL on this one.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability