Help in SSIS task of adding Data
I am trying to create a task of data import, my case is :
Taking P开发者_如何学运维roductOrderID from ORDERS table, and searching it in MAINORDERS table and fetch all the records that match the POrderID and once the match is found, I insert the result set to ORDERDETAILS table. and also in ORDERDETAILS table I like to add ORDERS's table OrderID as Foreign key.
Need a advice on how to perform this task.
Thanks
You would need to have a data source (OleDb or SqlServer probably, you don't state the DB being used), which selects the ProductOrderID from the Orders table, and the OrderID as well, since you'll need that later on. Then add a Lookup task to the MainOrders table, sending the matching rows to OrderDetails with an OleDb or SqlServer Destination task - the OrderID from the original source would be used to populate the FK. What do you need to do with non-matching rows?
精彩评论