I haven't tried but I guess something can be done with dynamic SQL.
You essentially do a Loop on all the tables to get their names, construct the Dynamic SQL Query and have a change of the tablename on each iteration.
Unless something can be done with straight T-sql which I'm not aware of.




Reply With Quote