Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shape-like query in T-SQL

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

My idea is to select multiple rows from a main table and all related records from a child table. That data would get loaded in to a DataSet and then I would create relations and use GetChildRows().

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

Is there a better solution available?

like image 287
Achim Avatar asked Apr 14 '10 15:04

Achim


1 Answers

The answer is quite simple: It's not possible at all! :-(

like image 195
Achim Avatar answered Sep 22 '22 06:09

Achim