I'm tasked to create a SQL statement which will create (and run?) multiple other queries which will select all related data outgoing from an given ID (uniqueidentifier) and a given table name.
It doesn't have to be that fast, but it should be able to use against every db, given only 1 ID and the table name.
In the DB, there are some 1:n, n:m etc. relations and not every table has a column named Id, some only have foreign-keys and it has to be fully dynamically and generic.
I tried to realize it by myself, but I'm not that good in SQL, I also tried some other scripts which will return the primary-foreign-key-relations but I'm stuck there so I'd thought you guys might help me :)
To be returned, I need (would be best) generated queries which I can run against the db and get all information returned (Are there other good return possibilities?)
Alternatively I could create this project in C#, but I'm stuck in attempt as well.
I'll appreciate any kind of help :)