dbTalk Databases Forums  

can dts "invert" data

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


Discuss can dts "invert" data in the microsoft.public.sqlserver.dts forum.



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

Default can dts "invert" data - 08-25-2005 , 03:28 PM






sql2k sp3a

Dont know if "invert" is the right word, but the only one I could come up
with. I have a flat file that displays data like:

GEN_PROREGCTCTXT CRZCODE S_GENERATION
1 CB 1
1 CS 1

That top row is data, not column names FYI. Anyways, what I need to do is
get that file into a table but I need it accross, not down. Meaning that the
rows 2 and 3 from column 1 will actually go into columns 2 and 3 in row 1.
It needs to look like:

GEN_PROREGCTCTXT 1 1
CRZCODE CB CS
S_GENERATION 1 1

Is there a way for DTS to handle something like this? Another good way to do
it?

TIA, ChrisR



Reply With Quote
  #2  
Old   
JXStern
 
Posts: n/a

Default Re: can dts "invert" data - 08-25-2005 , 11:08 PM






Import it into SQLServer the way it is, then look up how to code a
"pivot" query to turn it over.

J.


On Thu, 25 Aug 2005 13:28:50 -0700, "ChrisR" <noemail (AT) bla (DOT) com> wrote:
Quote:
sql2k sp3a

Dont know if "invert" is the right word, but the only one I could come up
with. I have a flat file that displays data like:

GEN_PROREGCTCTXT CRZCODE S_GENERATION
1 CB 1
1 CS 1

That top row is data, not column names FYI. Anyways, what I need to do is
get that file into a table but I need it accross, not down. Meaning that the
rows 2 and 3 from column 1 will actually go into columns 2 and 3 in row 1.
It needs to look like:

GEN_PROREGCTCTXT 1 1
CRZCODE CB CS
S_GENERATION 1 1

Is there a way for DTS to handle something like this? Another good way to do
it?

TIA, ChrisR



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.