I think you should use Dynamic SQL in this scenario.

Pl correct me if i m wrong.

SS