I have a requirement to analyse the each of the column values for a group of tables...table name will be a parameter value. I am not suppose to write a Store procedure. Is there any other alternative way to achieve iteration or looping of executing the same sql with changing table name and column name values with temp tables etc
The immediate solution that comes to my mind is that you can create a Macro having one parameter, tableName. That macro will return the complete SQL for that particular table, which then you need to execute.
But keep in mind that you CAN NOT loop in macro. You need to exec that macro, everytime you requrie the SQL for any specifc table.
Probably some more explanation will help to provide a better solution.