Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
hrishy
Starting Member
47 Posts |
Posted - 2008-05-09 : 16:12:00
|
Hi I am SSIS newbie and need help in desigining this flow.Source Sqlserver2005Select records based on complex sql statement from a [InstanceA].[DatabaseA].[TableA] Target Sqlserver2005Insert the records into another table [InstanceB].[DatabaseB].[TableB] only if these records are not presentTake the records from [InstanceB].[DatabaseB].[TableB] and insert it into [InstanceB].[DatabaseB].[TableC] only those records which are not in CAnd finallyTake the records from [InstanceB].[DatabaseB].[TableB] Join them with [InstanceB].[DatabaseB].[TableC] and insert it into [InstanceB].[DatabaseB].[TableD] only those records which are not already in D Can somebody please help me in visualising this solution .I am having problems populating a target and then using that populated target as a source for subsequent targets. regardsHrishy |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-10 : 02:11:29
|
You can use a dataflow task for this.Inside the daytaflow you will have :-1. OLEDB Source- where you get data from [InstanceA].[DatabaseA].[TableA]2.OLEDB Destination- Dump this data into a temporary table created in InstanceB. Maybe [InstanceB].[DatabaseB].[Staging]3. OLEDB Command - inserting the new records into TableBcommand is INSERT INTO TableBSELECT your required fields hereFROM Staging sLEFT JOIN TableB tON t.PKCol=s.PKColWHERE t.PKCol IS NULL4.OLEDB Command - inserting the new records into Tablec from TableBcommand is INSERT INTO TableCSELECT your required fields hereFROM TableB tbLEFT JOIN TableC tcON tc.PKCol=tb.PKColWHERE tc.PKCol IS NULL5.OLEDB Command - inserting the new records into TableD from B & Ccommand is INSERT INTO TableDSELECT your required fields hereFROM TableB tbINNER JOIN TableC tcON tc.PKCol=tb.PKColLEFT JOIN TableD tdON td.Col=tc.ColWHERE td.PKCol IS NULL |
 |
|
|
|
|