• You should use sp_executesql with parameters.

    Have a look at The Curse and Blessings of Dynamic SQL for a bit more info.