Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 4th, 2006, 01:20 PM
Registered User
 
Join Date: May 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting 2 rows into 1 in SSIS

I'm a few weeks into my new job as a SSIS data conversion guy and I'm starting to get a handle on a few things. However, I am having a few problems from poor data sent to us from an outside source. There are two main issues I have with various sources:

I solved my first problem, but i still need help on the second one:

2. I've avoided doing this second set of data soley because I know I don't know what to do with it. The data comes in two rows per actual dataset (I.E., the data is in two rows, but the destination should only have 1 row with condensed data). There is some duplicate data on the data rows, so obviously I want to take some data from both rows and send it to a database with only 1 row.

Any help, or steps in the right direction would be helpful.
 
Old May 4th, 2006, 04:25 PM
Registered User
 
Join Date: May 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

a bump for changes.

 
Old May 5th, 2006, 03:42 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post
Default

Assuming that the two rows have a column that indicates they belong together (like an id field) but then has some other column that can be used to tell them apart (assume a column called Part), then use a self join like this

SELECT T1.ID, T1.otherdata, T2.otherdata_minus_the_data_that_isduplicated
FROM Table1 as T1
JOIN Table1 as T2
ON T1.ID = T2.ID AND T1.Part > T2.Part


David Lundell
Principal Consultant and Trainer
www.mutuallybeneficial.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
DTS vs SSIS carumuga SQL Server 2005 0 July 23rd, 2008 09:09 AM
SSIS integration gunjan.sh SQL Server 2005 0 January 10th, 2008 07:22 AM
SSIS FAQ's ssaranam SQL Server 2005 0 December 21st, 2007 04:33 AM
SSIS Designer jesseleon SQL Server 2005 0 September 14th, 2006 02:01 PM
Limit rows returned and next rows minhpx General .NET 1 August 12th, 2004 06:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.