dbTalk Databases Forums  

How To Execute Custom task

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


Discuss How To Execute Custom task in the microsoft.public.sqlserver.dts forum.



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

Default How To Execute Custom task - 08-30-2005 , 07:38 AM






Hi Friends,
Can can any bady help me to call custome task
here is small snipet

CallSP("EXEC USP_DeleteReportingRecords 'Month To Date Half Hourly Report',
'07/15/2005'")

Function CallSP(Strsql)
Dim oPkg
Dim oExecSQL
Dim objTask
Dim sSQLStatement
set oPkg = DTSGlobalVariables.Parent
set oExecSQL= oPkg.Tasks("DTSTask_DTSExecuteSQLTask_1").CustomTa sk
oExecSQL.SQLStatement = Strsql
set objTask = oPkg.Steps("DTSStep_DTSExecuteSQLTask_1")
objTask.ExecutionStatus = DTSStepExecStat_Waiting
' objTask.Execute
' I would like to run DTSExecuteSQL here it self.
Set oExecSQL = Nothing
Set oPkg = Nothing
CallSP = DTSTaskExecResult_Success
End Function

I written this function in ActiveX Script. this will be called n number of
times.
before success of ActiveX script, executeSQL Task will be called.

I wating for your valuable responce.

Thanks and Regards,
Rajesh

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How To Execute Custom task - 08-30-2005 , 02:57 PM






Sounds like you want a loop and I have never needed to execute a task by itself through
the object model.

Try and adapt this

Looping, Importing and Archiving
(http://www.sqldts.com/default.aspx?246)



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know

On Tue, 30 Aug 2005 05:38:50 -0700, "Rajesha" <Rajesha (AT) discussions (DOT) microsoft.com> wrote:

Quote:
Hi Friends,
Can can any bady help me to call custome task
here is small snipet

CallSP("EXEC USP_DeleteReportingRecords 'Month To Date Half Hourly Report',
'07/15/2005'")

Function CallSP(Strsql)
Dim oPkg
Dim oExecSQL
Dim objTask
Dim sSQLStatement
set oPkg = DTSGlobalVariables.Parent
set oExecSQL= oPkg.Tasks("DTSTask_DTSExecuteSQLTask_1").CustomTa sk
oExecSQL.SQLStatement = Strsql
set objTask = oPkg.Steps("DTSStep_DTSExecuteSQLTask_1")
objTask.ExecutionStatus = DTSStepExecStat_Waiting
' objTask.Execute
' I would like to run DTSExecuteSQL here it self.
Set oExecSQL = Nothing
Set oPkg = Nothing
CallSP = DTSTaskExecResult_Success
End Function

I written this function in ActiveX Script. this will be called n number of
times.
before success of ActiveX script, executeSQL Task will be called.

I wating for your valuable responce.

Thanks and Regards,
Rajesh

Reply With Quote
  #3  
Old   
Rajesha
 
Posts: n/a

Default Re: How To Execute Custom task - 08-31-2005 , 10:38 PM



Hi Allan,
I not able to execute custom task. instead of executing SP in Execute SQL
task. I used OSQL DOS command utility from vb Script..

C:\>osa -Usa -Pods -S320.20.36.140 -dArchival -Q "USP_DeleteReportingRecords
'MonthToDate AHT Report', '07/06/2005'"

Thanks for your responce.
Rajesha

"Allan Mitchell" wrote:

Quote:
Sounds like you want a loop and I have never needed to execute a task by itself through
the object model.

Try and adapt this

Looping, Importing and Archiving
(http://www.sqldts.com/default.aspx?246)



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know

On Tue, 30 Aug 2005 05:38:50 -0700, "Rajesha" <Rajesha (AT) discussions (DOT) microsoft.com> wrote:

Hi Friends,
Can can any bady help me to call custome task
here is small snipet

CallSP("EXEC USP_DeleteReportingRecords 'Month To Date Half Hourly Report',
'07/15/2005'")

Function CallSP(Strsql)
Dim oPkg
Dim oExecSQL
Dim objTask
Dim sSQLStatement
set oPkg = DTSGlobalVariables.Parent
set oExecSQL= oPkg.Tasks("DTSTask_DTSExecuteSQLTask_1").CustomTa sk
oExecSQL.SQLStatement = Strsql
set objTask = oPkg.Steps("DTSStep_DTSExecuteSQLTask_1")
objTask.ExecutionStatus = DTSStepExecStat_Waiting
' objTask.Execute
' I would like to run DTSExecuteSQL here it self.
Set oExecSQL = Nothing
Set oPkg = Nothing
CallSP = DTSTaskExecResult_Success
End Function

I written this function in ActiveX Script. this will be called n number of
times.
before success of ActiveX script, executeSQL Task will be called.

I wating for your valuable responce.

Thanks and Regards,
Rajesh


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 - 2013, Jelsoft Enterprises Ltd.