dbTalk Databases Forums  

Datapump and Activex problem

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


Discuss Datapump and Activex problem in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ALI-R
 
Posts: n/a

Default Datapump and Activex problem - 03-02-2005 , 10:57 PM






I have this script in my datapump task ,I'd like to update a field in the
current row when an error happens ,,

Function Main()
IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
Main = DTSTransformStat_SkipInsert
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK

End Function

The problem of this script is that ,all fields (even those are not equal to
C1 ) are set to 55 and there is no 8888

Thanks
RoyAll



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

Default Re: Datapump and Activex problem - 03-03-2005 , 12:40 AM






You are asking to skip the insert if col001 = "C1". That would explain
missing values

Do you not want something like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
END IF
DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK



"ALI-R" <newbie (AT) microsoft (DOT) com> wrote


Quote:
I have this script in my datapump task ,I'd like to update a field in the
current row when an error happens ,,

Function Main()
IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
Main = DTSTransformStat_SkipInsert
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK

End Function

The problem of this script is that ,all fields (even those are not equal to
C1 ) are set to 55 and there is no 8888

Thanks
RoyAll


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

Default Re: Datapump and Activex problem - 03-03-2005 , 02:49 AM



In fact it should probably look more like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888

ELSE

DTSDestination("ERROR_STATUS") = 55
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")

Main = DTSTransformStat_OK



"Allan Mitchell" wrote:

Quote:
You are asking to skip the insert if col001 = "C1". That would explain
missing values

Do you not want something like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
END IF
DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK



"ALI-R" <newbie (AT) microsoft (DOT) com> wrote in message
news:newbie (AT) microsoft (DOT) com:

I have this script in my datapump task ,I'd like to update a field in the
current row when an error happens ,,

Function Main()
IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
Main = DTSTransformStat_SkipInsert
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK

End Function

The problem of this script is that ,all fields (even those are not equal to
C1 ) are set to 55 and there is no 8888

Thanks
RoyAll



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

Default Re: Datapump and Activex problem - 03-03-2005 , 10:09 AM



The trick here is that ,when a validation error happens I'd like to update a
column in the row and skip processing other columns in the row and move to
the next row.

Thanks for yuor reply
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
In fact it should probably look more like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888

ELSE

DTSDestination("ERROR_STATUS") = 55
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")

Main = DTSTransformStat_OK



"Allan Mitchell" wrote:

You are asking to skip the insert if col001 = "C1". That would explain
missing values

Do you not want something like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
END IF
DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK



"ALI-R" <newbie (AT) microsoft (DOT) com> wrote in message
news:newbie (AT) microsoft (DOT) com:

I have this script in my datapump task ,I'd like to update a field in
the
current row when an error happens ,,

Function Main()
IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
Main = DTSTransformStat_SkipInsert
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK

End Function

The problem of this script is that ,all fields (even those are not
equal to
C1 ) are set to 55 and there is no 8888

Thanks
RoyAll





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

Default Re: Datapump and Activex problem - 03-03-2005 , 01:30 PM



This is for Inserts right?

So providing you do not find a problem you insert to the destination
If you do find a problem then you update the same row you are processing
on the Source to something?

You may get locking contention


You could also log the Sources on the Source with which you have the
problems to a log table by using a Lookup that does an INSERT

You could also use the Source provider's syntax to filter out rows that
would cause you to not insert a row leaving you with only good rows and
then use another task that does the UPDATES after using a good WHERE
clause.




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


Quote:
The trick here is that ,when a validation error happens I'd like to update a
column in the row and skip processing other columns in the row and move to
the next row.

Thanks for yuor reply
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:4C6474AD-748C-4825-9C2F-4B7F14D5530E (AT) microsoft (DOT) com...
In fact it should probably look more like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888

ELSE

DTSDestination("ERROR_STATUS") = 55
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")

Main = DTSTransformStat_OK



"Allan Mitchell" wrote:

You are asking to skip the insert if col001 = "C1". That would explain
missing values

Do you not want something like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
END IF
DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK



"ALI-R" <newbie (AT) microsoft (DOT) com> wrote in message
news:newbie (AT) microsoft (DOT) com:

I have this script in my datapump task ,I'd like to update a field in
the
current row when an error happens ,,

Function Main()
IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
Main = DTSTransformStat_SkipInsert
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK

End Function

The problem of this script is that ,all fields (even those are not
equal to
C1 ) are set to 55 and there is no 8888

Thanks
RoyAll




Reply With Quote
  #6  
Old   
ALI-R
 
Posts: n/a

Default Re: Datapump and Activex problem - 03-05-2005 , 02:45 AM



I update the same row in the destination not source.
Thanks
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
This is for Inserts right?

So providing you do not find a problem you insert to the destination
If you do find a problem then you update the same row you are processing
on the Source to something?

You may get locking contention


You could also log the Sources on the Source with which you have the
problems to a log table by using a Lookup that does an INSERT

You could also use the Source provider's syntax to filter out rows that
would cause you to not insert a row leaving you with only good rows and
then use another task that does the UPDATES after using a good WHERE
clause.




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


The trick here is that ,when a validation error happens I'd like to
update a
column in the row and skip processing other columns in the row and move
to
the next row.

Thanks for yuor reply
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:4C6474AD-748C-4825-9C2F-4B7F14D5530E (AT) microsoft (DOT) com...
In fact it should probably look more like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888

ELSE

DTSDestination("ERROR_STATUS") = 55
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")

Main = DTSTransformStat_OK



"Allan Mitchell" wrote:

You are asking to skip the insert if col001 = "C1". That would
explain
missing values

Do you not want something like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
END IF
DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK



"ALI-R" <newbie (AT) microsoft (DOT) com> wrote in message
news:newbie (AT) microsoft (DOT) com:

I have this script in my datapump task ,I'd like to update a field
in
the
current row when an error happens ,,

Function Main()
IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
Main = DTSTransformStat_SkipInsert
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK

End Function

The problem of this script is that ,all fields (even those are not
equal to
C1 ) are set to 55 and there is no 8888

Thanks
RoyAll






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

Default Re: Datapump and Activex problem - 03-05-2005 , 03:37 AM



The datapump is for inserts. Depending on batch sizes you cannot really
do an UPDATE because the row does not really exist.

Is this the same Q as your validation question using Global Variables?



"ALI-R" <Ray (AT) Alirezaei (DOT) com> wrote


Quote:
I update the same row in the destination not source.
Thanks
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:uWelbbCIFHA.236 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
This is for Inserts right?

So providing you do not find a problem you insert to the destination
If you do find a problem then you update the same row you are processing
on the Source to something?

You may get locking contention


You could also log the Sources on the Source with which you have the
problems to a log table by using a Lookup that does an INSERT

You could also use the Source provider's syntax to filter out rows that
would cause you to not insert a row leaving you with only good rows and
then use another task that does the UPDATES after using a good WHERE
clause.




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


The trick here is that ,when a validation error happens I'd like to
update a
column in the row and skip processing other columns in the row and move
to
the next row.

Thanks for yuor reply
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:4C6474AD-748C-4825-9C2F-4B7F14D5530E (AT) microsoft (DOT) com...
In fact it should probably look more like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888

ELSE

DTSDestination("ERROR_STATUS") = 55
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")

Main = DTSTransformStat_OK



"Allan Mitchell" wrote:

You are asking to skip the insert if col001 = "C1". That would
explain
missing values

Do you not want something like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
END IF
DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK



"ALI-R" <newbie (AT) microsoft (DOT) com> wrote in message
news:newbie (AT) microsoft (DOT) com:

I have this script in my datapump task ,I'd like to update a field
in
the
current row when an error happens ,,

Function Main()
IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
Main = DTSTransformStat_SkipInsert
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK

End Function

The problem of this script is that ,all fields (even those are not
equal to
C1 ) are set to 55 and there is no 8888

Thanks
RoyAll





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

Default Re: Datapump and Activex problem - 03-05-2005 , 02:41 PM



yes,they are some how related.I'll follow it up there (in my other posting)

Thanks for monitoring my threads

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
The datapump is for inserts. Depending on batch sizes you cannot really
do an UPDATE because the row does not really exist.

Is this the same Q as your validation question using Global Variables?



"ALI-R" <Ray (AT) Alirezaei (DOT) com> wrote


I update the same row in the destination not source.
Thanks
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:uWelbbCIFHA.236 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
This is for Inserts right?

So providing you do not find a problem you insert to the destination
If you do find a problem then you update the same row you are
processing
on the Source to something?

You may get locking contention


You could also log the Sources on the Source with which you have the
problems to a log table by using a Lookup that does an INSERT

You could also use the Source provider's syntax to filter out rows that
would cause you to not insert a row leaving you with only good rows and
then use another task that does the UPDATES after using a good WHERE
clause.




"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:RayAll (AT) microsft (DOT) com:

The trick here is that ,when a validation error happens I'd like to
update a
column in the row and skip processing other columns in the row and
move
to
the next row.

Thanks for yuor reply
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:4C6474AD-748C-4825-9C2F-4B7F14D5530E (AT) microsoft (DOT) com...
In fact it should probably look more like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888

ELSE

DTSDestination("ERROR_STATUS") = 55
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")

Main = DTSTransformStat_OK



"Allan Mitchell" wrote:

You are asking to skip the insert if col001 = "C1". That would
explain
missing values

Do you not want something like

IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
END IF
DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK



"ALI-R" <newbie (AT) microsoft (DOT) com> wrote in message
news:newbie (AT) microsoft (DOT) com:

I have this script in my datapump task ,I'd like to update a
field
in
the
current row when an error happens ,,

Function Main()
IF DTSSource("Col001") <> "C1" THEN
DTSDestination("ERROR_STATUS")= 8888
Main = DTSTransformStat_SkipInsert
END IF

DTSDestination("RECORD_TYPE") = DTSSource("Col001")
DTSDestination("ERROR_STATUS") = 55
Main = DTSTransformStat_OK

End Function

The problem of this script is that ,all fields (even those are
not
equal to
C1 ) are set to 55 and there is no 8888

Thanks
RoyAll







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 - 2013, Jelsoft Enterprises Ltd.