Hallo,
I read a lot of documentation and found no soloution. I want to create an DTS Package. First I give you an overview over the actual and the target state. At the end there are the todo taks.
How can give me some tips? Thank you very much.
Michael
actual state
Source
dBase file +----------+----------+------+--+------+----+----+
Quote:
Artikel-Nr|HERSTELLER|PREIS1|AB|PREIS2|LIEF|TEXT| |
+----------+----------+------+--+------+----+----+
Quote:
4711 |VW |10,00 | | |C1 |A | |
+----------+----------+------+--+------+----+----+
Quote:
4712 |VW |20,00 | | |C1 |A | |
+----------+----------+------+--+------+----+----+
Quote:
4713 |IBM |10,50 | | |C1 |B | |
+----------+----------+------+--+------+----+----+
Quote:
4714 |VOLVO |40,50 | 5|30,00 |C1 |B | |
+----------+----------+------+--+------+----+----+
Destination
Hersteller +--+----------+
+--+----------+
+--+----------+
+--+----------+
+--+----------+
Artikel +----------+--+----+----+
+----------+--+----+----+
+----------+--+----+----+
+----------+--+----+----+
+----------+--+----+----+
+----------+--+----+----+
Preis +----------+---+-----+
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
TAB1 +----------+----+
+----------|----+
+----------+----+
+----------|----+
TAB2 +----------+----+
+----------|----+
+----------+----+
target state
Hersteller +--+----------+
+--+----------+
+--+----------+
+--+----------+
+--+----------+
+--+----------+
+--+----------+
Artikel +----------+--+----+----+
+----------+--+----+----+
Quote:
4708 | 2|C2 |B | (without changes, LIEF = C2) |
+----------+--+----+----+
Quote:
4709 | 2|C1 |C | DELETE (LIEF = C1 AND NOT IN TAB1 AND / OR TAB 2) |
+----------+--+----+----+
Quote:
4710 | 1|C1 |B | (without changes, Artikel not in Sourcedatabase) |
+----------+--+----+----+
+----------+--+----+----+
Quote:
4712 | 1|C1 |A | UPDATE OF FIELD TEXT |
+----------+--+----+----+
+----------+--+----+----+
+----------+--+----+----+
Preis +----------+---+-----+
+----------+---+-----+
Quote:
4708 |1 |1 | (without changes, Lieferant = C2) |
+----------+---+-----+
Quote:
4708 |2 |1,10 | (without changes, Lieferant = C2) |
+----------+---+-----+
Quote:
4709 |1 |1 | DELETE (LIEF = C1 AND NOT IN TAB1 AND / OR TAB 2) |
+----------+---+-----+
Quote:
4709 |2 |1,10 | DELETE (LIEF = C1 AND NOT IN TAB1 AND / OR TAB 2) |
+----------+---+-----+
Quote:
4710 |1 |5 | (without changes, Artikel is in TAB 1 und / oder TAB 2 |
+----------+---+-----+
Quote:
4710 |2 |5,50 | (without changes, Artikel is in TAB 1 und / oder TAB 2 |
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
Quote:
4712 |1 |20,00| UPDATE OF PREIS (SOURCE.PREIS*1) |
+----------+---+-----+
Quote:
4712 |2 |22,00| UPDATE OF PREIS (SOURCE.PREIS*1,1) |
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
+----------+---+-----+
1. DELETE * FROM ARTIKEL WHERE LIEF="C1" AND ARTIKEL-NR (NOT IN TAB1 OR NOT IN TAB2)
2. DELETE * FROM PREIS WHERE LIEF="C1" AND ARTIKEL-NR (NOT IN TAB1 OR NOT IN TAB2)
3. Fill Database Hersteller (Redout highest ID + 1) without setting column identity to YES!!!!!
4. Fill (INSERT & UPDATE) of database Artikel including readout of the ID from datase Hersteller
5. Fill (INSERT & UPDATE) of database Preise. Every Artikel-Nr must be write twice into database with PID 1 + PID 2.
i. PID 1 = PREIS from source database
ii. PID 2 = PREIS from source database * 1,2