March 15, 2005 at 7:01 am
Hi there.
I am relatively new to the world of DTS programming. So far, I have been quite impressed with what it can do.
I now have a package that processes files sitting in a source directory, loading the data into a SQL Server table.
My question is this ... there are a number of places in the package where I use a MsgBox function to provide feedback. Typically, this only happens once when the package is completed.
I now want to schedule the package as a job. Obviously, I don't want to use MsgBox in this case. Is there a simple way to tell if the package is being run as a job as opposed to running directly within SQL Server Enterprise Manager?
Thanks in advance.
- Mike
March 16, 2005 at 1:51 am
March 16, 2005 at 5:42 am
That's a good idea, thanks.
I think I didn't word my question that well. I was considering mixing my code with Msgbox commands (to use when I running the package directly myself) and Print commands (to use when the package runs as a job). If I had some way to determine what context the package was running in, I could use a simple IF statement to decide which method of feedback to use.
This may not be possible and I'm starting to think I should just use Print commands (or whatever) to log progress regardless of how the package runs.
March 16, 2005 at 1:38 pm
Hi,
You can use Global variable and when you are calling DTS package from the job you can specify different value for this variable using parameter /~A in DTSRUN command.
Otakar
Otakar
March 16, 2005 at 2:25 pm
Mike,
There is no way that the package can know where it has been executed from (which is what you are asking). However you can TELL it where it is being executed from which is exactly what Otakar has suggested. His approach would be my approach.
Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
March 16, 2005 at 3:01 pm
Thanks for the tips.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply