February 25, 2012 at 3:14 pm
Hello everybody,
I have a question on SSIS 2008:
Here is an example:
I have a table with two columns:
Identifier customer Version
5 1
5 2
5 3
I want to load in the target table the third line: 5 (Identifier customer) 3 (Version).
Do you know how to do?
Thanks a lot for your answers.
February 25, 2012 at 7:57 pm
Probably not the best method, but you could use SSIS to import the data into a "Staging Table" and then execute a T-SQL statement to do what you want to do. For example
CREATE TABLE #Temp(Identifier_customer INT, [Version] INT)
INSERT INTO #Temp
SELECT 5, 1 UNION ALL
SELECT 5, 2 UNION ALL
SELECT 5, 3 UNION ALL
SELECT 6, 0 UNION ALL
SELECT 7, 2
SELECT Identifier_customer,MAX([Version]) FROM #Temp GROUP BY Identifier_customer
Result:
Identifier_customer(No column name)
5 3
6 0
7 2
February 26, 2012 at 5:43 am
Thanks a lot Ron but I want to use only SSIS transformation.
Would you have an idea?
Thanks
February 26, 2012 at 7:55 am
Unfortunately I am not a fan of SSIS, the only further assistance I can suggest is to read the "Starways" articles for SSIS
February 26, 2012 at 8:12 am
Thanks a lot Ron.
I don't find the answer to my issue.
It seems complicated.:(
February 26, 2012 at 12:48 pm
ilan_2610 (2/26/2012)
Thanks a lot Ron.I don't find the answer to my issue.
It seems complicated.:(
By what logic do you want that last row.
Is it always the last row, or the one with the maximum version, as Bitbucket suggested?
If it's the max, use the aggregate transform.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply