![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |