dan 91669 - Thursday, August 10, 2017 10:08 AM
Because the way in which you have defined your lookup results in more than one row being returned for the same match key.
Ok so i looked at the tutorial i used - i grabbed the wrong arrow (apparently obviously).
What about the other question?
I presume that you are using a table as the source for your data flow?
If so, change this to a query and add whatever filter criteria you need.
Why did i miss that.
Ok, last one. SSIS figures out through the lookup what the new rows (invoices) are in the header, how do i capture those rows (invoice numbers) and make it an easy task for SSIS to grab the new rows from the detail table in Sage?
dan 91669 - Thursday, August 10, 2017 11:43 AM
That is the tricky part.
Do the invoice numbers follow some sort of ascending sequence? Or do they contain a 'DateCreated' column?
Phil Parkin - Thursday, August 10, 2017 11:48 AM
Invoices are ascending, but not continuous. 1234, 1235, 1236, 2234,2235,3234, etc. So i can't just grab everything after such 1234. There is no date.
dan 91669 - Thursday, August 10, 2017 11:56 AM
OK, but if you know that Max(InvoiceNo) from your target db is, say, 500, can you not do
select cols
from source
where InvoiceNo > 500
to find new rows?
Are we to assume that existing rows cannot be updated or deleted? Or if they can, that you are not interested in cascading these changes to the target db?
Phil Parkin - Thursday, August 10, 2017 12:03 PM
Cannot really change anything on the source server.
Invoice numbers are broken up by different parameters to create invoice series's, therefore i can't really set a starting point. Since the header and detail both have invoiceNumber as a field, i was hoping to use the results of the header sync task to fascinate the detail sync.
dan 91669 - Thursday, August 10, 2017 12:39 PM
OK, so you want to be able to capture the fact that Invoices a, b and c are new and then, somehow, modify the query which selects the detail rows such that it filters them at source to include only those which belong to a, b and c?
I can't think of an elegant way of doing that in SSIS. Easy enough in T-SQL.
To be honest, I am very surprised that these tables do not have date columns which you can use.
Phil Parkin - Thursday, August 10, 2017 1:09 PM
yeah, you and me both. Sage decided to let the transaction and invoice dates live in the header but not the detail. There are no other date fields utilized, and even if they were they likely wouldn't be key fields anyway.... you know just to add insult to injury.
So i guess this leaves me with doing a lookup on the entire detail tables? i feel bad for my ram and cpu...
dan 91669 - Thursday, August 10, 2017 1:17 PM
OK, then I think that there is a way forward.
1) SELECT MAX(TransDate) from invoice header on target table and store in a variable in SSIS
2) Modify your header select queryselect cols
from invoiceHeader (source table)
WHERE TransDate >= [Max Trans Date variable]
3) Modify your detail select queryselect d.cols
from invoiceDetail d
join invoiceHeader h on d.InvoiceNo = h.InvoiceNo
where h.TransDate >= [Max Trans Date variable]
got it. it works. Although truth be told i didnt get the variable to work but i am using the join - i didnt think that would work in the query. (yeah head on desk for not even trying)
Viewing 13 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply