dbTalk Databases Forums  

Data pump task and transforming Data

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


Discuss Data pump task and transforming Data in the microsoft.public.sqlserver.dts forum.



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

Default Data pump task and transforming Data - 03-02-2005 , 03:14 PM






Hi All,

I'm using a Data pump task which transorms a CSV file to a Table (Source:CSV
file,Destination:Table) .There are some columns in the Table which don't
exist in the CSV file.I'd like to update those columns in transforming rows
..IS it possible?

Thanks



Reply With Quote
  #2  
Old   
Simon Worth
 
Posts: n/a

Default Re: Data pump task and transforming Data - 03-02-2005 , 03:19 PM






yes, just select the column from the table without a source that you want to
add data to and you can do your transformations within an ActiveX script

"RayAll" <RayAll (AT) microsft (DOT) com> wrote

Quote:
Hi All,

I'm using a Data pump task which transorms a CSV file to a Table
(Source:CSV
file,Destination:Table) .There are some columns in the Table which don't
exist in the CSV file.I'd like to update those columns in transforming
rows
.IS it possible?

Thanks





Reply With Quote
  #3  
Old   
RayAll
 
Posts: n/a

Default Re: Data pump task and transforming Data - 03-02-2005 , 03:31 PM



Simon,

Here is what I want to do:

Source: Column1
Destination: Colunm1,Column2

I'd like to check Column1(while it's being transfered) and if it's for
instance more than 5 ,I'd like to update Column2 (in the destination) and
skip processing the current row (using DTSTransformStat_skip).

Thanks


"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote

Quote:
yes, just select the column from the table without a source that you want
to
add data to and you can do your transformations within an ActiveX script

"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:OMYydz2HFHA.4032 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Hi All,

I'm using a Data pump task which transorms a CSV file to a Table
(Source:CSV
file,Destination:Table) .There are some columns in the Table which don't
exist in the CSV file.I'd like to update those columns in transforming
rows
.IS it possible?

Thanks







Reply With Quote
  #4  
Old   
Simon Worth
 
Posts: n/a

Default Re: Data pump task and transforming Data - 03-02-2005 , 03:42 PM



Yes, you can defietly do that within an activeX script task.
In the transformation section of the data pump task, select column1 on the
left side, and select column1 and column2 on the right hand side. Then
click new transformation and select type of ActiveX.

Then you can run case statements within to either update column2 only or
column1 only

example
Function Main()
Select Case DTSSource("Column1")
Case "First Check"
DTSDestination("Column1") = DTSSource("Column1")
Case "Second Check"
DTSDestination("Column2") = "The value you want to assign"
End Select
Main = DTSTransformStat_OK
End Function


"RayAll" <RayAll (AT) microsft (DOT) com> wrote

Quote:
Simon,

Here is what I want to do:

Source: Column1
Destination: Colunm1,Column2

I'd like to check Column1(while it's being transfered) and if it's for
instance more than 5 ,I'd like to update Column2 (in the destination) and
skip processing the current row (using DTSTransformStat_skip).

Thanks


"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote in message
news:%23O5V112HFHA.2564 (AT) tk2msftngp13 (DOT) phx.gbl...
yes, just select the column from the table without a source that you
want
to
add data to and you can do your transformations within an ActiveX script

"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:OMYydz2HFHA.4032 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Hi All,

I'm using a Data pump task which transorms a CSV file to a Table
(Source:CSV
file,Destination:Table) .There are some columns in the Table which
don't
exist in the CSV file.I'd like to update those columns in transforming
rows
.IS it possible?

Thanks









Reply With Quote
  #5  
Old   
RayAll
 
Posts: n/a

Default Re: Data pump task and transforming Data - 03-02-2005 , 03:55 PM



Simon,

I thin this is not gonna work to me ,because the column2 actually contains
the error code that might happen for checking each column.Let me tell you
the whole senario.

I have 33 columns in my CSV file ,In my destination Table there are 34
columns.
I am going to validate every single field (in each row) and if they don't
meet the validation (for instance if they are null where they are not
supposed to be null) ,I am going to update the 34th row with an error code
which I am getting from a lookup.so in every single field I should be able
to to have access to the 34th column.When the data pump task is done.I am
going to execute another package (or another pump task) to distribute all
rows (considering the error code in the 34th column) into 3 different
tables.

Hopefully I could transfer what I am doing now.If you have any suggessions
on the whole concept ,I would be really grateful to hear that.

Thanks
"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote

Quote:
Yes, you can defietly do that within an activeX script task.
In the transformation section of the data pump task, select column1 on the
left side, and select column1 and column2 on the right hand side. Then
click new transformation and select type of ActiveX.

Then you can run case statements within to either update column2 only or
column1 only

example
Function Main()
Select Case DTSSource("Column1")
Case "First Check"
DTSDestination("Column1") = DTSSource("Column1")
Case "Second Check"
DTSDestination("Column2") = "The value you want to assign"
End Select
Main = DTSTransformStat_OK
End Function


"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:eXP1j82HFHA.3364 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Simon,

Here is what I want to do:

Source: Column1
Destination: Colunm1,Column2

I'd like to check Column1(while it's being transfered) and if it's for
instance more than 5 ,I'd like to update Column2 (in the destination) and
skip processing the current row (using DTSTransformStat_skip).

Thanks


"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote in message
news:%23O5V112HFHA.2564 (AT) tk2msftngp13 (DOT) phx.gbl...
yes, just select the column from the table without a source that you
want
to
add data to and you can do your transformations within an ActiveX
script

"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:OMYydz2HFHA.4032 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Hi All,

I'm using a Data pump task which transorms a CSV file to a Table
(Source:CSV
file,Destination:Table) .There are some columns in the Table which
don't
exist in the CSV file.I'd like to update those columns in transforming
rows
.IS it possible?

Thanks











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.