dbTalk Databases Forums  

invalid procedure call or argument DTSSource

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


Discuss invalid procedure call or argument DTSSource in the microsoft.public.sqlserver.dts forum.



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

Default invalid procedure call or argument DTSSource - 02-21-2005 , 10:11 AM






I'm using the vbscript below to import values into SQL Server. If a column
is null then I want another value used from a different column.
But I keep gettin the error "invalid procedure call or argument DTSSource"

Any thoughts.
Here is the code.
'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

' Copy each source column to the destination column
Function Main()

If isnull(DTSSource("Col041").value) and not
isnull(DTSSource("Col042").value) Then
DTSDestination("VID") = DTSSource("Col042")
DTSDestination("VType") = "SA"
ElseIf isnull(DTSSource("Col042").value) and not
isnull(DTSSource("Col041").value) Then
DTSDestination("VID") = DTSSource("Col041")
DTSDestination("VType") = "CA"
ELSE DTSDestination("VType") = "NA"

End If
Main = DTSTransformStat_OK
End Function

Thanks,

LP

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

Default Re: invalid procedure call or argument DTSSource - 02-21-2005 , 01:13 PM






Try taking the .Values from your DTSSource references.

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

Quote:
I'm using the vbscript below to import values into SQL Server. If a
column
is null then I want another value used from a different column.
But I keep gettin the error "invalid procedure call or argument
DTSSource"

Any thoughts.
Here is the code.
'************************************************* *********************
' Visual Basic Transformation Script

'************************************************* ***********************

' Copy each source column to the destination column
Function Main()

If isnull(DTSSource("Col041").value) and not
isnull(DTSSource("Col042").value) Then
DTSDestination("VID") = DTSSource("Col042")
DTSDestination("VType") = "SA"
ElseIf isnull(DTSSource("Col042").value) and not
isnull(DTSSource("Col041").value) Then
DTSDestination("VID") = DTSSource("Col041")
DTSDestination("VType") = "CA"
ELSE DTSDestination("VType") = "NA"

End If
Main = DTSTransformStat_OK
End Function

Thanks,

LP


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

Default Re: invalid procedure call or argument DTSSource - 02-21-2005 , 03:11 PM



Hi Alan,

Thanks very much for your help on a few issues. I later realized that the
Transformation Properties had columns in the souyrce and destination tabs.
Once I removed those the code ran fine.

Thanks,

LP

"Allan Mitchell" wrote:

Quote:
Try taking the .Values from your DTSSource references.

"LP" <LP (AT) discussions (DOT) microsoft.com> wrote in message
news:LP (AT) discussions (DOT) microsoft.com:
I'm using the vbscript below to import values into SQL Server. If a
column
is null then I want another value used from a different column.
But I keep gettin the error "invalid procedure call or argument
DTSSource"

Any thoughts.
Here is the code.
'************************************************* *********************
' Visual Basic Transformation Script

'************************************************* ***********************

' Copy each source column to the destination column
Function Main()

If isnull(DTSSource("Col041").value) and not
isnull(DTSSource("Col042").value) Then
DTSDestination("VID") = DTSSource("Col042")
DTSDestination("VType") = "SA"
ElseIf isnull(DTSSource("Col042").value) and not
isnull(DTSSource("Col041").value) Then
DTSDestination("VID") = DTSSource("Col041")
DTSDestination("VType") = "CA"
ELSE DTSDestination("VType") = "NA"

End If
Main = DTSTransformStat_OK
End Function

Thanks,

LP



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.