Solved

Executing a DTS package from a stored Procedure

Posted on 2001-06-04
6
408 Views
Last Modified: 2013-11-30
Hi All

How can I execute a DTS package stored on my SQL Server from a stored procedure.

Many Thanks

0
Comment
Question by:demmick
6 Comments
 
LVL 18

Expert Comment

by:nigelrivett
ID: 6153391
look at dts_run and xp_cmdshell.
Or you could set the job to run under the scheduler then use sp_startjob.
0
 
LVL 18

Expert Comment

by:nigelrivett
ID: 6153396
oops dtsrun
0
 

Author Comment

by:demmick
ID: 6155430
I know of the dtsrun comand but I can't use it in the Query analyser.  I am assuming that it will work in the stored procedure if it works in the query analyser.
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 2

Expert Comment

by:niklausj
ID: 6157470
you can't use dtsrun directly from qa or sp, since it's a DOS command, you need to run it via xp_cmdshell (blocking) or add a job and use sp_startjob in your sp.
0
 
LVL 8

Expert Comment

by:chigrik
ID: 6158367
Read about "How can I run a DTS package from within SQL Server - e.g. a stored-procedure?"
http://www.ntfaq.com/Articles/Index.cfm?ArticleID=14230

Hope this helps
0
 
LVL 2

Accepted Solution

by:
iamari earned 15 total points
ID: 6754390
in the stored proc is like:

exec master..xp_cmdshell 'DTSRun /S (local) /U sa /P  /N myPackageName', NO_OUTPUT

where User id (sa) and Password (if existing) should be provided
no_output prevents the server from sending back the "Loading... " message to user
0

Featured Post

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.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

920 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now