I have a table that has two attributes, one holding database names, the other holds tables in the respective databases. I want a result set that at least prints a series of queries combining both, like so:SELECT TOP 1 * FROM database1.name1SELECT TOP 1 * FROM database1.name2SELECT TOP 1 * FROM database2.name1
so that I can copy the result and then paste, then run. How do I concatenate the result of SELECT database FROM table + SELECT name FROM table
to yield the above? Without dynamic SQL would be nice.