We help IT Professionals succeed at work.

How to stop DTS for few second

pg_india
pg_india asked
on
464 Views
Last Modified: 2013-11-30
I am using DTS(VB Script Task) to scan a folder for availability of 3 files. if the files are not present the DTS should wait till the files are placed manually. I am achieving this by using a while loop and coming out of loop when the file is there. File checking i am using scripting object. But the problem with this method is that THE CPU UTILIZATION IS 100% as the while loop is running always. IS THERE A WAY SO THAT THE TASK SHOULD "SLEEP" FOR SOME TIME LETS SAY 1 MINUTE/5 MINUTE AND AFTER THAT AGAIN START OVER..something like sleep command?

Help needed..
Comment
Watch Question

I would say your best bet would be to take the while loop out of there. Have the package execute if the file is there. So basically set it to run once, look for the file, if the file is there great do its thing, if not then exit.

Then schedule this DTS package to run as a job on the SQL Server. Have it run on whatever frequency you want. You can do this by right clicking on the DTS package after going to the Data Transformation Services -- > Local Packages area in Enterprise Manager. Right click on the package and click schedule job.
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Hilaire,

The command is not working. Do i need to create any object and set it.

thanks for your reply.

Also is there some timer concept in DTS

Commented:
No need to create any object

I created a sample .vbs on my machine to test
it has the two following lines
--
Wscript.sleep(10000)
Wscript.echo "hello"
--
it displays a message box  after 10 secs

maybe wscript comes with recent (5.5 and above i guess) versions of IE

at my site it is on each and every server that has received the normal security patches / service packs

I'll have a look on google and see if I can come up with more precise information


Hilaire



Author

Commented:
i am getting error with this object.
i am using waitfor function provided by SQL.

thanks for your help.
points urs
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.