dbTalk Databases Forums  

if...else question

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


Discuss if...else question in the microsoft.public.sqlserver.dts forum.



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

Default if...else question - 08-20-2003 , 05:29 PM






sql2k sp3

Im trying to import data from a .txt file into a sql
table. In Active X, if Col001 in the file = "1" then it
should be inserted into a certain table. If not it should
be skipped.

if DTSSource("Col001") = "1" then

DTSDestination("au_id") = DTSSource("Col002")
DTSDestination("au_lname") = DTSSource("Col003")
DTSDestination("au_fname") = DTSSource("Col004")
DTSDestination("phone") = DTSSource("Col005")
DTSDestination("address") = DTSSource("Col006")
DTSDestination("city") = DTSSource("Col007")
DTSDestination("state") = DTSSource("Col008")
DTSDestination("zip") = DTSSource("Col009")
DTSDestination("contract") = DTSSource("Col010")
Main = DTSTransformStat_OK
else
DTSTransformStat_SkipRow
end if
End Function

I try to run this and it highlights the (if DTSSource
("Col001") = "1" then) in yellow and fails. Any ideas why
would be appreciated.

Thanks, Chris.

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.