dbTalk Databases Forums  

Configure a DTSDataDrivenQueryTask with ActiveX

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


Discuss Configure a DTSDataDrivenQueryTask with ActiveX in the microsoft.public.sqlserver.dts forum.



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

Default Configure a DTSDataDrivenQueryTask with ActiveX - 08-09-2006 , 03:53 PM






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



Reply With Quote
  #2  
Old   
Davide
 
Posts: n/a

Default Re: Configure a DTSDataDrivenQueryTask with ActiveX - 08-10-2006 , 06:49 AM






Hello Michel,

Quote:
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

I' m not sure : it seems you need to create the DataDrivenQueryTask2 not
at design time (using Ent.Mang.) but at runtime ?
Is it?




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.