Solved

DTS - Execute Package Task

Posted on 2001-09-07
15
256 Views
Last Modified: 2013-11-30
At which version/SP level  does the Execute Package Task get introduced to DTS?
I just noticed it's not available on a SQL 7 server, and I was hoping to get this
feature without converting to SQL 2000 just yet.
0
Comment
Question by:vd
  • 4
  • 4
  • 3
  • +2
15 Comments
 

Expert Comment

by:racosta
ID: 6464943
It is available on sqlserver 7
0
 

Expert Comment

by:racosta
ID: 6464951
with dtsrun from DOS
0
 
LVL 1

Expert Comment

by:SYASSIN
ID: 6465958
I dont believe the execute package task is available in SQL Server 7.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6466660
i couldn't verify, but if it is available in SQL Server 7, then only from SP3 on, which has some options related to SQL 2000...

Listening & Learning
0
 

Expert Comment

by:racosta
ID: 6470548
If you type from DOS : dtsrun, you will be able to specify the package that you want to run connecting to the server.
   If it doesn't work find it in ..\mssql7\binn
0
 
LVL 1

Expert Comment

by:SYASSIN
ID: 6470562
I dont think this is what vd is asking.  Please clarify vd -
1) do you want to know how to execute a dts in sql server 7 from the command prompt?

2) to know if you can execute processes normally done at the command prompt as part of a dts in sql server 7?

- sy
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6470818
SYASSIN, in SQL 2000 you can execute a single step from a DTS package, even if the package contains several steps.

The question is really if this is a functionality that is available in SQL 7 SPx or not...

CHeers
0
 

Expert Comment

by:racosta
ID: 6470852
Of course...I use it on SQLServer 7...With Enterprise Manager you can create a package with several steps and task, save and execute it immediate, or scchedule it.
0
 

Author Comment

by:vd
ID: 6470966
Thanks for the comments!
Clarification: The Execute Package Task is available from the Toolbox in DTS
on 2000. It allows one to execute an already created package from the current
package.  It is not available in SQL 7 sp1.
I was hoping someone knew if this task is available in one of the SQL 7 SP's
(or have an alternate suggestion), so that I don't have to install SQL 2000
on the server just yet!
0
 
LVL 6

Expert Comment

by:curtis591
ID: 6471934
If you want to run a dts package on 7 you can create a vb script task and do the following

Set dts_package = CreateObject("DTS.package")
dts_package.LoadFromSQLServer "SERVER", "USER", "PASSWORD", , , , , "PACKAGE"    

dts_package.execute()
   
0
 

Author Comment

by:vd
ID: 6477505
The vb script task sounds great.
I don't see a vb script task though...do you mean the Active Script task, or
something else?
0
 
LVL 6

Expert Comment

by:curtis591
ID: 6478003
Yep that is it.
0
 

Author Comment

by:vd
ID: 6479667
I tried the vb script. It didn't work ( a syntax error).
Could you explain/expand  the example somewhat?
0
 
LVL 6

Accepted Solution

by:
curtis591 earned 75 total points
ID: 6479776
I have taken this code and substituted the server name, user name , password and package name and tested it on my server and I seemed to work ok.   Let me know how you make out.  
'**********************************************************************
'  Visual Basic ActiveX Script
'************************************************************************

Function Main()
  Dim fso, opackage, oconn, file_list, dts_package, status

   Set dts_package = CreateObject("DTS.package")
   dts_package.LoadFromSQLServer "MYSERVER", "MY USER", "MY PASSWORD", , , , , "MY PACKAGE"    

  dts_package.execute()
   
      'Check DTS Errors if some are found then an email is sent
      found_error = check_dts_errors (dts_package)

      dts_package.UnInitialize
      Set dts_package = Nothing

     Main = DTSTaskExecResult_Success
End Function

function check_dts_errors (dts_package)
 Dim errsource, errdescription, lperrorcode

 check_dts_errors = "0"
 For i = 1 To dts_package.Steps.Count
   If dts_package.Steps(i).ExecutionResult = DTSStepExecResult_Failure Then
      check_dts_errors = "1"
   End If
 Next
end function
0
 

Author Comment

by:vd
ID: 6482630
Thanks, this is an excellent work around!

Angeliii   : Thanks, indeed SP3 does not have the Execute Package object available.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server tables join on parse list 6 22
export sql results to csv 6 34
SSRS 2012 r2 - Parm Drop Down has Date/Time 12 31
optimize stored procedure 6 23
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question