dbTalk Databases Forums  

DTS and functions - didn't get it at all

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


Discuss DTS and functions - didn't get it at all in the microsoft.public.sqlserver.dts forum.



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

Default DTS and functions - didn't get it at all - 06-01-2004 , 03:27 PM






Hi NG
I read a lot of articles about "DTS and functions/SPs" but i guess i didn't
get it at all.
So, here's my code with which i tried to integrate a function call inside a
data transformation. And it doesn't work.

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("Artikelnummer") = DTSSource("Artikelnummer")
DTSDestination("Suchbegriff") = DTSSource("Suchbegriff")

--that's the function call that doesn't work!!
DTSDestination("Datumletztenderung") =
dbo.udfDTFromDecimal2(CONVERT(numeric(6,0),DTSSour ce("Datumletztenderung")))

DTSDestination("LetzterEkPreis") = DTSSource("LetzterEkPreis")
Main = DTSTransformStat_OK
End Function

Thanks,
Steffen



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

Default Re: DTS and functions - didn't get it at all - 06-02-2004 , 12:35 AM






Inside the script which is where you are now you do not have access to
objects outside in this way.

Either

Use the TSQL function in the SourceSQLStatement of your datapump

OR

Create a VBScript version inside the Active script transform and use that.



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Steffen Klipfel" <steffen.klipfel (AT) no (DOT) spam> wrote

Quote:
Hi NG
I read a lot of articles about "DTS and functions/SPs" but i guess i
didn't
get it at all.
So, here's my code with which i tried to integrate a function call inside
a
data transformation. And it doesn't work.

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("Artikelnummer") = DTSSource("Artikelnummer")
DTSDestination("Suchbegriff") = DTSSource("Suchbegriff")

--that's the function call that doesn't work!!
DTSDestination("Datumletztenderung") =

dbo.udfDTFromDecimal2(CONVERT(numeric(6,0),DTSSour ce("Datumletztenderung")))

DTSDestination("LetzterEkPreis") = DTSSource("LetzterEkPreis")
Main = DTSTransformStat_OK
End Function

Thanks,
Steffen





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.