Hi Abhishek,
Yup, I'm confused. ![]()
I'd recommend you try querying TABLE_COLUMNS to get an idea of how to use it. It will always have the exact columns of a table. So any time the table changes, this system table will also update with the correct column names.
Using a join on TABLE_COLUMNS, you'd effectively filter the data down to only those rows dealing with the specific columns of interest.
As for further filtering based on the input table, you could be able to do that by creating a dynamic WHERE clause, and then passing this into APPLY_FILTER() function that's been available since SP6.