I would advise against any architecture or design that requires the passing of portions of queries as parameters. It's messy, it causes a hell of a lot of problems.
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