Hi Everyone, I need some help to pass row value to the other task in SSIS package.here is my sample query select distinct txnno from tbltxn, what I need is to get distinct txnno from this qurey and delete records from other table based on this txnno. I think we can pick txxno in some variable in a foreach in a container and pass that recordset value to the query which is used to delete.But I have not done this before , so I need some clues and examples to solve this problem. Thank you Mushtaq
My suggest is to use lookup tool and OLEDB Command or Script Component tool instead of using foreach in a container - Create tbltxn as your OLEDB Data source - Use lookup tool to find the matching txno records between tbltxn and your other table(Say DestTable) that you wish to delete - use OLEDB Command or Script Component to delete the records from DestTable based on the matching record.
Mushtaq. If I understand you correctly, you want to delete records in one table by selecting values from another. You do not need to do this using a loop, you should use set-based T-SQL to achieve this result. Something like this would do the trick DELETE FROM dbo.TableA WHERE txnno IN (SELECT DISTINCT txnno from dbo.tbltxn) This query could be run in SSIS if you want it to be part of a chronologically ordered set of commands.