• This is one of the few cases where dynamic SQL should be considered.

    Take a look at this [/url]article on the subject, particularly the 'dynamic SQL' bit.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.