September 14, 2004 at 9:53 am
September 15, 2004 at 7:00 am
Don't know if I am reading your post correctly or not, but assume you need something like this in the activex task -
DTSGlobalVariables("gv1").value = Month(DTSGlobalVariables("gv2").value)
Hope it helps.
September 15, 2004 at 8:34 am
I was already able to assign GV2.
The problem was that GV1 is of type int and GV2 is of type "string".
September 15, 2004 at 9:14 am
This should do it...
' Assuming GV1 is formatted as YYYYMMDD Dim sz_month, sz_dest, o_task sz_month = Left(DTSGlobalVariables("GV1"), 6) sz_dest = "[Database].[Owner].[Table_Prefix_" & sz_month & "]"
' If you don't know the actual name of the task, right-click in the DTS Editor and select ' "disconnected edit", expand the "Tasks" tree and find the one you're looking for. ' In the right-hand pane, you'll find the "Name" property. ' It's usually something like: DTSTask_DTSDataPumpTask_# ' Replace the TASK_NAME place holder in the assignment below
Set o_task = DTSGlobalVariables.Tasks("TASK_NAME") o_task.Properties("DestinationObjectName").Value = sz_dest DTSGlobalVariables("GV2") = sz_month
September 15, 2004 at 9:26 am
My post must have executed the same time as your followup.
If you're using TSQL as your source of the data pump task, you can still follow the examples above. Dig around in the Disconnected Editor to see the properties available to you.
To build on my previous post, you could convert all your Int types to String prior to using any string functions.
sz_GV1 = CStr(DTSGlobalVariables("GV1"))
Then use the Left() function on the string var.
Then, dynamically build your SQL statement using your variables & gVariables.
Finalize it with:
o_task.Properties("SourceSQLStatement") = sz_sql
Hope this helps.
--b
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply