I have 50+ tables in a database.
I don't want to use the following SQL on each table in a database.
select top 10 * from {table_name}
So, is it possible to display the first 10 records PLUS only show the 2nd and 3rd column for each table inside the same database using sql?
(If the table does not have the 2 columns - it will display the 1st and 2nd column. If the table have 1 column, it will display the 1st column. If the table have more than 2 column, it will display the 2nd and 3rd column. If the table does not have any column, then display nothing.)
ORDER BY
there is no such concept as "first 10"... – Aaron Bertrand Feb 27 '13 at 19:59sp_MSforeachtable
form my other similar question (dba.stackexchange.com/questions/35529/…) – Jack Feb 28 '13 at 1:00sp_MSforeachtable
. – Aaron Bertrand Feb 28 '13 at 3:31