![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi I have a question about how I'm able to configure a DTSDataDrivenQueryTaks. My idea is, that I create a DTS Package with the enterprise manager. there i have an active x script and the DTSDataDrivenQueryTaks. Before I run the DTSDataDrivenQueryTaks, I run the active x script to configure the DTSDataDrivenQueryTaks. My question is now, how can i create a DataDrivenQueryTask2 and where can I configure all the mapping? Thanks for some advice I found this example which shows a way: 'Set objTask = pkg.Tasks.New("DTSDataDrivenQueryTask") Set objTask = pkg.Tasks("DTSTask_DTSDataDrivenQueryTask_1") Set objDDQTask = objTask.CustomTask With objDDQTask .Name = "Test1" .SourceConnectionID = 2 .SourceObjectName = "[pubs].[dbo].[employee]" .DestinationConnectionID = 1 .DestinationObjectName = "[DTSTest].[dbo].[EmployeeHires]" .InsertQuery = "UPDATE StartYearCounts" & vbCrLf & _ "SET NumberStarts = NumberStarts + 1 " & vbCrLf & _ "WHERE StartYear = datepart( yyyy, ? )" & vbCrLf & _ "INSERT INTO EmployeeHires (FullName, StartDate) VALUES (?, ?)" .UpdateQuery = "UPDATE StartYearCounts" & vbCrLf & _ "SET NumberStarts = NumberStarts + 1 " & vbCrLf & _ "WHERE StartYear = datepart( yyyy, ? )" & vbCrLf & _ "UPDATE MissingStuff SET MissingMI = MissingMI + 1" & vbCrLf & _ "INSERT INTO EmployeeHires (FullName, StartDate) VALUES (?, ?)" With .InsertQueryColumns .AddColumn "StartDate", 1 .AddColumn "FullName", 2 .AddColumn "StartDate", 3 End With With .UpdateQueryColumns .AddColumn "StartDate", 1 .AddColumn "FullName", 2 .AddColumn "StartDate", 3 End With End With |
![]() |
| Thread Tools | |
| Display Modes | |
| |