![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi! Here is my situation. The source and destination are both SQL Server. ================================================== ================= Goal :transform customer's telephone number. ================================================== ================= Source Column: Cust_Seril_No Tel_Type Tel_No 12345 Home 123-4567 12345 Office 234-4567 67890 Home 321-4321 ================================================== ================= Destination Column Cust_Seril_No Tel_Seq_No Tel_Type Tel_No 12345 1 Home 123-4567 12345 2 Office 234-4567 67890 1 Home 321-4321 ================================================== ================= The different Column between souce and destination is "Tel_Seq_No" Because we use Cust_Seril_No AND Tel_Seq_No to be the PK of the destination. When doing transformation,the same cust's different tel_no must has different Tel_Seq_No ,which can be automatically increased. In our AP,we have a component to do serial number genaration. So I take that code in the ActiveX Script of transformation. Our component generates serial number by checking the exist and max one. After that,it will add one to the max number and return the result. It now seems the component always generates serial number "1" and won't increase the number. So in the above example,12345's Home Tel can be inserted successfully, but 12345's Office Tel will be failed. I don't know what's wrong with my setting in transformation task of the properties's option tab. I uncheck the "Use Fast Load" (I use MultiStep Pump to handle insert error. Friends told me if I use fast load,I can't catch insert failure event in transformation,so I uncheck it) The other setting is by default Max Error Count is 9999 Fetch Buffer Size is 1 And the line in transformation tab is--- Cust_Seril_No,Tel_Type,Tel_No use copy column Tel_Seq_No has no Source and use ActiveX Script to generate it. I doubt 10 records dont' insert 10 times, so when the first record's Tel_Seq_No is generated, it hasn't inserted in DB. Then the second record get the same Tel_Seq_No. After that,the insertion starts and only first record can successfully be inserted. Can anyone tell me how to solve this problem? Thank a lot!!!! |
#3
| |||
| |||
|
|
SELECT A.CustSerialNo, (SELECT Count(*) FROM CustTelNumbers B WHERE B.CustSerialNo = A.CustSerialNo And B.TelNo > a.TelNo) + 1 as Counter, A.TelType, A.TelNo FROM CustTelNumbers A Order By 1 |
![]() |
| Thread Tools | |
| Display Modes | |
| |