Solved

Trying to open multiple CMD.EXE's to run simultaneously in my DTS Package

Posted on 2004-08-24
11
519 Views
Last Modified: 2012-06-27
I have a SQL DTS job and at one point, I call five concurrent DOS processes in an attempt to spawn 5 file copy processes simultaneously.

Each of the 5 concurrent DTS steps runs a batch file that copies a file from a remote server to the local machine.  I am calling the batch file like:

start c:\Batches\FileCopy.bat

In the batch file, I have

copy MyFile c:\Files\
exit

I thought that by using start and exit, my 5 DTS steps would cause 5 CMD.EXE's to be opened simultaneously, but when I watch Task Manager, I see one CMD.EXE, although the Process ID is changing constantly as the files are copied.

Can anyone tell me if this is working normally or how to cause 5 separate CMD.EXE's to be opened simultaneuosly?
0
Comment
Question by:ABaruh
11 Comments
 
LVL 23

Expert Comment

by:adilkhan
Comment Utility
Why Dont you Create a JOB and Then Run each BAT file for Each STEP?
0
 
LVL 7

Author Comment

by:ABaruh
Comment Utility
There's a lot more that is happening in the SQL that calls the BAT
0
 
LVL 19

Expert Comment

by:Melih SARICA
Comment Utility
Yes its normal to see only one CMD o process list.

It does'nt run any process till a command runs. and every command creates a process on OS.


0
 
LVL 7

Author Comment

by:ABaruh
Comment Utility
non_zero, are you saying that I don't need to be concerned about seeing one CMD.EXE in Task Manager and that it is still running the various processes simultaneously?  Please clarify.

Nevertheless, why is it that if I open multiple command windows manually (by typing cmd in my Run dialog box) I will see a separate CMD.EXE for each of those windows?
0
 
LVL 11

Expert Comment

by:ram2098
Comment Utility
I don't think you can call 5 cmd.exe's in one DTS package with 5 steps.

Not sure what was logic inside this ...

But, you can create 5 DTS package and run them simulataneously. This might work.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 8

Expert Comment

by:bukko
Comment Utility
I don't think you are ever going to guarantee simultaneous copying.
If this is absolutley necessary you might want to consider creating a multi-threaded component in VB which creates 5 child objects, each of which wait on separate threads for an exact moment when they start copying together.
Even then, there may be some lag between copies.
0
 
LVL 7

Author Comment

by:ABaruh
Comment Utility
You guys are getting away from the point.  I'm pretty sure this can be done as I can multi-copy manually if I open 5 dos windows and perform file copies simultaneously in each of them.  Let's focus on why I'm not seeing 5 CMD.EXE's launching.
0
 
LVL 7

Author Comment

by:ABaruh
Comment Utility
I figured it out:

I had to create 5 separate SQL Server connections inside my DTS Package, and each of the 5 concurrent DTS steps were given their own SQL connection (each of the 5 DTS steps runs a stored proc that executes xp_cmdshell).
0
 
LVL 34

Expert Comment

by:arbert
Comment Utility
Close the question...
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
Comment Utility
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Moderator
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

772 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

10 Experts available now in Live!

Get 1:1 Help Now