I have a table it is called “Users”
Users table has UserId as a primary key and it is a foreign key for other 15 tables.
Is there a query template which will select top 200 rows from users and all related tables in one shot? So i will not need to type all other 15 tables in the query.
Would Query dynamically find and bring columns from related tables?
It can use inner join for all relations between tables.
I will admit that this is super ugly and probably needs lots more work, but it does the basic query generation based on PK/FK relations. You should probably change inner join to left join, if any of the FK tables can be missing corresponding PK records.