You have to use dynamic sql. Look for sp_executesql in BOL.
How many tables are involved in this process? Wouldn't it be better to create separate procedure for each table? I am asking because I don't think personally that such loose interface is good for performance and maintenance of application. Of course, there are cases when it can't be avoided
Piotr
...and your only reply is slàinte mhath