Out of my lack of SQL Server experience and taking into account that this task is a usual one for Line of Business applications, I'd like to ask, maybe there is a standard, common way of doing the following database operation:
Assume we have two tables, connected with each other by one-to-many relationship, for example SalesOderHeader
and SalesOrderLines
Field SalesHeaderNo
is a PK in SalesOderHeader
table and a FK in SalesOrderLines
table.
In a front-end app a User selects some number of records in the SalesOderHeader
table, using for example Date range, or IsSelected
field by clicking checkbox fields in a GridView. Then User performs some operations (let it be just "move to another table") on selected range of Sales Orders.
My question is:
How, in this case, I can reach child records in the SalesOrderLines
table for performing the same operations (in our case "move to another table") over these child records in as easy, correct, fast and elegant way as possible?