dbTalk Databases Forums  

Regarding DATAPUMP

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


Discuss Regarding DATAPUMP in the microsoft.public.sqlserver.dts forum.



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

Default Regarding DATAPUMP - 05-06-2004 , 03:21 PM






hi
I wrote an activex script in the data pump. I have a flag that will be set depending on the column value in the text file. Based on the flag, I was to transform the data from source to destination. So, the code looks like this

Function Main(
Flag = GetTheColumnValu
If Flag = 1 The
DTSDestination(1) = DTSSource(1
....
...
End I
End Functio

So, whenever the Flag is not 1, the data should not be transferred. But, the column 1 in the destination is a primary key
so, the datapump is throwing an exception, primary key cann't be null....blah blah..

Am I doing some thing wrong? How can I avoid the transformation if the flag is not 1
any ideas are appreciated

thanks
Sreenat



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

Default Re: Regarding DATAPUMP - 05-07-2004 , 03:39 AM






OK

So you have a text file that perhaps looks like

MyCol
1
2
3
4
5


You want to move all rows that are <> 1


I know this isn't your exact scenario but the principal is the same

In your Active Script transform you need to do this

Function Main()

select case DTSSource("MyCol")

case "1"

Main = DTSTransformStat_SkipInsert

case else

DTSDestination("MyCol") = DTSSource("MyCol")

Main = DTSTransformStat_OK

end select

End Function



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Sreenath" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
hi,
I wrote an activex script in the data pump. I have a flag that will be
set depending on the column value in the text file. Based on the flag, I
was to transform the data from source to destination. So, the code looks
like this:
Quote:
Function Main()
Flag = GetTheColumnValue
If Flag = 1 Then
DTSDestination(1) = DTSSource(1)
.....
....
End If
End Function

So, whenever the Flag is not 1, the data should not be transferred. But,
the column 1 in the destination is a primary key.
so, the datapump is throwing an exception, primary key cann't be
null....blah blah...

Am I doing some thing wrong? How can I avoid the transformation if the
flag is not 1.
any ideas are appreciated.

thanks,
Sreenath





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

Default Re: Regarding DATAPUMP - 05-07-2004 , 10:52 AM



Thanks Allan
Good Suggestion.

Quote:
-----Original Message-----
OK

So you have a text file that perhaps looks like

MyCol
1
2
3
4
5


You want to move all rows that are <> 1


I know this isn't your exact scenario but the principal
is the same

In your Active Script transform you need to do this

Function Main()

select case DTSSource("MyCol")

case "1"

Main = DTSTransformStat_SkipInsert

case else

DTSDestination("MyCol") = DTSSource("MyCol")

Main = DTSTransformStat_OK

end select

End Function



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Sreenath" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news1D5CD78-D062-4AF7-A5D9-974EDE8540DB (AT) microsoft (DOT) com...
hi,
I wrote an activex script in the data pump. I have a
flag that will be
set depending on the column value in the text file.
Based on the flag, I
was to transform the data from source to destination. So,
the code looks
like this:

Function Main()
Flag = GetTheColumnValue
If Flag = 1 Then
DTSDestination(1) = DTSSource(1)
.....
....
End If
End Function

So, whenever the Flag is not 1, the data should not be
transferred. But,
the column 1 in the destination is a primary key.
so, the datapump is throwing an exception, primary key
cann't be
null....blah blah...

Am I doing some thing wrong? How can I avoid the
transformation if the
flag is not 1.
any ideas are appreciated.

thanks,
Sreenath




.


Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: Regarding DataPump - 08-25-2004 , 03:06 PM



In message <9028F81C-A3EE-4501-9495-946A2BB791C3 (AT) microsoft (DOT) com>,
Sreenath <Sreenath (AT) discussions (DOT) microsoft.com> writes
Quote:
Hi,
I am experiencing a strange situation. I have a excel file (97-2000
Office)version. I am trying to read the file throught DTS datapump. That
file has some columns, values will be either numbers or "--" and headings are
in string. Some how, DTS is not able to recognize the numerical values but
able to see the headings.

If I open the file in EXCEL, the cell format was General.

Any clue?

Thanks,
Sreenath
Maybe this will help-

Excel treats First Row of Data as Headers
(http://www.sqldts.com/Default.aspx?255)

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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

Default Re: Regarding DataPump - 08-25-2004 , 04:29 PM



Thanks for the reply, we thought the same but unfornately it is not and the
behaviour is weird.

Detailed description:
In my excel file, the first few rows (6) are blanks and the next 3 rows were
headers and from 10row the data starts. If numerical value exists for that
cell, then the value will be numeric otherwise it will be "--". We found
that the format cell of those columns is Generic.
But, in the DataPump source screen preview, we could see only some of the
numeric values other numeric values are blanks. If you want I can send you a
screen short of the file and preview in data pump.

thanks,
Sreenath


"Darren Green" wrote:

Quote:
In message <9028F81C-A3EE-4501-9495-946A2BB791C3 (AT) microsoft (DOT) com>,
Sreenath <Sreenath (AT) discussions (DOT) microsoft.com> writes
Hi,
I am experiencing a strange situation. I have a excel file (97-2000
Office)version. I am trying to read the file throught DTS datapump. That
file has some columns, values will be either numbers or "--" and headings are
in string. Some how, DTS is not able to recognize the numerical values but
able to see the headings.

If I open the file in EXCEL, the cell format was General.

Any clue?

Thanks,
Sreenath

Maybe this will help-

Excel treats First Row of Data as Headers
(http://www.sqldts.com/Default.aspx?255)

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.