Form-like query in T-SQL

I would like to write a T-SQL statement that structures the data to be loaded into the DataSet Ado.Net, as was possible with the ADO SHAPE command. Is there something similar in T-SQL?

My idea is to select multiple rows from the main table and all related records from the child table. This data will be loaded into the DataSet, and then I will create the relationship and use GetChildRows ().

The most direct solution would be to select the records from the main table into the temporary table, and then use "select * from child_table, where ParentID in (select Id from #temp)." But in more complex scenarios, the code will become pretty ugly.

Is there a better solution?

+5
source share
1

: !: - (

+5

All Articles