dbTalk Databases Forums  

parallel tasks in DTS

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


Discuss parallel tasks in DTS in the microsoft.public.sqlserver.dts forum.



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

Default parallel tasks in DTS - 09-05-2003 , 05:30 PM







I am thinking of using DTS to runs several tasks in
parallel by creating task dynamically from a package. The
task should execute store procedure include sever
parameters. Should it be custom task and how do I
execute the task as I create them, any example will be
appreciated.


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

Default Re: parallel tasks in DTS - 09-08-2003 , 11:24 AM






Hi Allan,

I am trying to run several tasks in parallel and I thought
DTS’s tasks are the ideal implementation. Your example
seems to support it,

sSQLStatement = "SELECT TOP 1 FROM dbo.employee WHERE
hire_date > '" & _
DTSGlobalVariables("HireDate").Value & "'"

' Get reference to the DataPump Task
Set oPkg = DTSGlobalVariables.Parent
FOR I = 1, 4
Set oDataPump = oPkg.Tasks
("DTSTask_DTSDataPumpTask_1").CustomTask

' Assign SQL Statement to Source of DataPump
oDataPump.SourceSQLStatement = sSQLStatement
‘ Can I execute here??
' Clean Up
Set oDataPump = Nothing
Set oPkg = Nothing


'Udpdate dbo.employee ....
Update dbo.employee ...
NEXT

Is this will excute in threads?

Ahmed.
Quote:
-----Original Message-----
If you are rebuilding DTS packages as you go and adding
tasks then executing
them then I would seriously ask myself is DTS the tool to
use. You can
create a package that has a server connection and an
ExecuteSQL task. The
connection would be where the ExecuteSQL task executes
and the ExecuteSQL
task would be what executes, in your case 1+ stored procs.
You can dynamically change all of these settings i.e
Servername,
databasename, SQL Statement(Stored Proc)

Have a look at the site

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)

--


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


Reply With Quote
  #3  
Old   
Ahmed Zayan
 
Posts: n/a

Default Re: parallel tasks in DTS - 09-08-2003 , 01:26 PM



This is closer to what I want to do:
Function Main()
Dim oPkg, oDataPump, sSQLStatement

' Build new SQL Statement
sSQLStatement = "SELECT * FROM dbo.employee WHERE
hire_date > '" & _
DTSGlobalVariables("HireDate").Value & "'"

' Get reference to the DataPump Task
Set oPkg = DTSGlobalVariables.Parent

For I = 1, 4
Set oDataPump = oPkg.Tasks
("DTSTask_DTSDataPumpTask_" & I).CustomTask

' Assign SQL Statement to Source of DataPump
oDataPump.SourceSQLStatement = sSQLStatement

'Do I need an execute here?
' Clean Up
Set oDataPump = Nothing
NEXT
Set oPkg = Nothing

Main = DTSTaskExecResult_Success
End Function

Quote:
-----Original Message-----
Hi Allan,

I am trying to run several tasks in parallel and I
thought
DTS’s tasks are the ideal implementation. Your example
seems to support it,

sSQLStatement = "SELECT TOP 1 FROM dbo.employee WHERE
hire_date > '" & _
DTSGlobalVariables("HireDate").Value & "'"

' Get reference to the DataPump Task
Set oPkg = DTSGlobalVariables.Parent
FOR I = 1, 4
Set oDataPump = oPkg.Tasks
("DTSTask_DTSDataPumpTask_1").CustomTask

' Assign SQL Statement to Source of DataPump
oDataPump.SourceSQLStatement = sSQLStatement
‘ Can I execute here??
' Clean Up
Set oDataPump = Nothing
Set oPkg = Nothing


'Udpdate dbo.employee ....
Update dbo.employee ...
NEXT

Is this will excute in threads?

Ahmed.
-----Original Message-----
If you are rebuilding DTS packages as you go and adding
tasks then executing
them then I would seriously ask myself is DTS the tool
to
use. You can
create a package that has a server connection and an
ExecuteSQL task. The
connection would be where the ExecuteSQL task executes
and the ExecuteSQL
task would be what executes, in your case 1+ stored
procs.
You can dynamically change all of these settings i.e
Servername,
databasename, SQL Statement(Stored Proc)

Have a look at the site

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)

--


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

.


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.