August 19, 2010 at 4:32 pm
Hi,
I'm importing Oracle data into SQL Server. After my OLE DB Source that runs a query to grab the data to process, I'm trying to call a TSQL function on a field value somehow...
I have an SSIS data flow where I have a datetime column called DepartureDateGMT, and an integer column called DepartureTimeZoneKey.
I have a TSQL Function called dbo.udf_ConvertFromGMT(datetime,int) that returns a datetime
I am trying to create an OLE DB Command that fills a column called DepartureDate that holds the value of the call:
dbo.udf_ConvertFromGMT(DepartureDateGMT,DepartureTimezoneKey)
for each row in the SSIS dataflow.
I'm not updating/inserting into an existing table, I'm just trying to store the result into the DepartureDate column of each row of the data flow's dataset
I have tried alot of things, like
Exec ? dbo.udf_ConvertFromGMT(?,?)
SELECT dbo.udf_ConvertFromGMT(DepartureDateGMT,DepartureTimezoneKey)
dbo.udf_ConvertFromGMT(?,?)
DECLARE @Result DATETIME SET @Result = dbo.udf_ConvertFromGMT(?,?)
But I'm getting :Syntax Error, permission violation or other nonspecific error
Am I barking up the wrong tree? I have tried using DerivedColumn, but it doesnt allow calling a TSQL function.
Thanks!
Rick Hodder
August 20, 2010 at 2:21 am
You can try to write the data to a staging table first.
Then call the UDF in the database itself and write the results to your final destination table.
This is all set based, so it should run a little faster.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply