Friday, February 24, 2012

Conditiional DTS package start

Let's imagine that we have "conditional" start of DTS package (for
this post I will call it DoIt)
DTS package DoIt must be started when particular event occur.
Event is: we have an empty folder on the disk. When an outside program
send a file (for example message.txt) in that folder - it is a signal
that DTS package DoIt can be started.
So, we must permanently check is the message.txt file exist in that
folder. Also, when DTS package is started we must exclude possibility
that DTS package DoIt start once or more again (because message.txt
file is there).
Can anybody help me with this problem. Is it possible to write a
program that:
- permanently check is the message.txt exist in a folder
- start DTS package DoIt when the message.txt exist
- rename a message.txt file -> message.old
... or someone have a better idea?
Thanks for your answers...> Can anybody help me with this problem. Is it possible to write a
> program that:
> - permanently check is the message.txt exist in a folder
> - start DTS package DoIt when the message.txt exist
> - rename a message.txt file -> message.old
You can create a scheduled job with ActiveX script task, and then in
VBScript use FileSystemObject to check the folder for the file. Then you run
the package with DTSRun and finally rename or move the file with
FileSystemObject again. I have an example how to use FileSystemObject in
VBScript at
http://solidqualitylearning.com/blo...12/19/225.aspx. You
can schedule this job on every hour, for example, if this is enough.
More advanced solution can be written in .NET using the FileSystemWatcher
Class.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com|||Dear Dejan,
I also have idea (with some others) that solution with VBS will
probably give me a solution. Unfortunately, my knowledge about VBS is
very limited.
The employers who know about VBS are leaving my company. No time for
learning for me. And now I need a quick solution.
I know that is unusual to ask you this, but when I saw your code I
hope that VBS that I need is not big problem for you. But it is for
me.
Is it possible to send me VBS that solve my problem?
I will understand if you have no time or think that my wish is unfair.
Thank you for your post and any new.
Best regards.

No comments:

Post a Comment