Re: Need DTSRUN Utility to complete before proceeding
From: SqlGuy (homeNONO_at_gregNOscottNO.COM)
Date: 09/29/04
- Next message: SqlGuy: "Re: How do i do the following in DTS"
- Previous message: SqlGuy: "Re: Save DTS Package?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 29 Sep 2004 04:12:37 GMT
Paul Muller wrote:
> Want to add DTSRUN command in bat file and have that complete before
> proceeding, what is the best way?
>
> Also would like the bat file to fail if the DTSRUN utility fail, what
> would the code be for that?
>
> DTSRun.exe -s "<server name>" -e -n "Con_OPR_Adj_Prod"
>
> Other commands.............
If the program fails, it may return a suitable errorlevel, so failure is
discerned at the command line prodessor. In that case it's easy. I
forget the details but it looks something like this in a CMD file:
DTSRun.exe -s "<server name>" -e -n "Con_OPR_Adj_Prod" ||
successcommand && failcommand
the double pipe and double ampersand are commands to execute on failure
and success of the first command. This is from my unreliable memory, so
look it up.
Also, I'll tell you from bitter experience that DTS tasks do NOT run the
same when run in the scheduler as when they're run on the server under
the same user id as the service. This caused many headaches.
One difference noted was that there was a tendency for one task to be
launched before another completely finished, when this was NOT observed
running the task in the Enterprise Manager gui. There are a number of
possible solutions to this. the syntax above is useful, where command
line commands are issued, because the conditional portion essentially
forces the batch to wait for the executable to run to completion, so
that success or failure can be evaluated. Thus, each step is done before
proceeding to the next step. If you write a BAT file, it tends to work
one-at-a-time, but not in a CMD file.
Another major issue I have is that when working on the enterprise
manager on your own desktop, connected to the target server, when you
design tasks that some of the tasks component reference your LOCAL
workstation's environment, rather than being entirely executed on the
server. I can see how this might be a feature rather than a flat-out
bug, but it's truly annoying. For example, the EMAIL tasks depend on the
client of the local machine, where the profiles may not match, and email
addresses may resolve differently (another issue. I always use SMTP
addresses, since they always "work". A valid email address today may
become unresolvable tomorrow, though.)
Another issue is Oracle client connectivity, ODBC connectivity, and
similar issues. I'm writing a process to run on the server as a
scheduled task, under a service, and I DON'T want to have to recreate
the server environment on my desktop. The only way I can accurately
model the scheduler enviroment is in the scheduler itself, where it's
largely "invisible", since it's running on an internal virtual desktop.
- Next message: SqlGuy: "Re: How do i do the following in DTS"
- Previous message: SqlGuy: "Re: Save DTS Package?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|