Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Select Case statement in DTS package?

Author  Topic 

UncleRoydee
Starting Member

3 Posts

Posted - 2001-02-01 : 15:15:24
Can anyone tell me the syntax for a Select Case statement in a VB data transformation script within a Data Transformation Service package? Or if it is even possible? I've tried many different iterations, VB and SQL derivatives, to no avail. My latest iteration is this:
DTSDestination("Tst_Prfrm_YN") = SELECT CASE(DTSSource("Testconducted?")
when N then 0
when Y then 1
ELSE 0
END )

As an aside, the following works for a "Left" function in the same script, and it does not appear to be standard VBScript syntax:
Function Main()
DTSDestination("C_NBR_Agcy") = LEFT(DTSSource("Contract Number"),6)

BTW, I'm using SQL Server 7 and my source database is Access

Thanks,

Roy

   

- Advertisement -