dbTalk Databases Forums  

Use SSIS for split rows in columns

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Use SSIS for split rows in columns in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Anja
 
Posts: n/a

Default Use SSIS for split rows in columns - 07-28-2006 , 10:22 AM






Hi,
I've many rows and I want to split them in many columns, with SSIS.
I've this scenario:

INPUT TABLE

id date
--------------------
1 2006-02-04
1 2006-03-08
1 2006-10-15
2 2006-03-07
2 2006-09-17

OUTPUT TABLE

id date1 date2 date3
-----------------------------------------------------
1 2006-02-04 2006-03-08 2006-10-15
2 2006-03-07 2006-09-17 null

How kind of instrument I must use????

Thanks in advance
Anja

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Use SSIS for split rows in columns - 07-29-2006 , 04:19 AM






Hello Anja,

I personally would be using a Script Component (Or Custom Transform) to do
this or you could of course use the Pivot Transform (remember to sort the
input).

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/extran9/html/55f5db6e-6777-435f-8a06-b68c129f8437.htm

The problem though is that you are required to know how many values would
be in the Value column (date)

If as in your example you have 3 then uyou can use either of my examples


Allan



Quote:
Hi,
I've many rows and I want to split them in many columns, with SSIS.
I've this scenario:
INPUT TABLE

id date
--------------------
1 2006-02-04
1 2006-03-08
1 2006-10-15
2 2006-03-07
2 2006-09-17
OUTPUT TABLE

id date1 date2 date3
-----------------------------------------------------
1 2006-02-04 2006-03-08 2006-10-15
2 2006-03-07 2006-09-17 null
How kind of instrument I must use????

Thanks in advance
Anja



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.