Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTSRUN

Status
Not open for further replies.

jacob94

Technical User
Dec 5, 2005
161
US
I am firing a DTSRUN batch file on incoming emails from an outlook start application command. Someone emails and it automatically runs a batch file that runs a DTSRUN command. The issue I am having now is if two emails coming in at the same time, it fires the same batch file twice and the first one really needs to finish before the second one starts. Is there a way to make it wait until the first DTS run is complete? Like a que, if 5 emails came in, don't fire the DTSRUN until the other are done.
 
You would need to program this into the batch file or DTS package.

Why not use xp_readmail to read the mailbox. This can be done in a loop, which will only allow one message to be processed at a time, and in the order received.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
I need to go the batch or dts package, sqlmail is not an option for me, unfortunitly...

Can you help?

I just want to delay the DTS package from start twice and wait for the first to finish.
 
Here's a cheesy solution ....

Have the DTS either set a table value or create a temp file somewhere when it starts and destroy it when it stops. If the indicator is on already, the package will pause until the indicator is off.

For example Step 1 checks table tblDTS field Status. If status = true, then DTS waits. When status = false, DTS package sets the value to true and continues. When package finishes (last step), it sets status back to false. Now another package can run.



The early bird gets the worm, but the second mouse gets the cheese.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top