Re: Need DTSRUN Utility to complete before proceeding

From: SqlGuy (homeNONO_at_gregNOscottNO.COM)
Date: 09/29/04


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.



Relevant Pages

  • Remotly Launch Excel Worksheet
    ... I'm trying to launch a .bat file which launches an Excel ... The above command just hangs with a status of TIMW, ... The .bat file on the MS 2000 server work fines if I ...
    (microsoft.public.excel.misc)
  • batch file to run a command on another server
    ... whole lot with batch files/scripts. ... The user currently has access to a share on the server ... Even with the NET USE command how does the bat file know ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Shell Command
    ... The bat file is in server. ... without the running bat file or without using shell command. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ie6sp1 : Repair Function Blocked - Anyone know of a fix?
    ... for command itself not to the thing it is being used to execute. ... then modifying it to do the call and append, then execute the bat file. ... Then edit dlls.bat to prefix each line with getvers and append>>versions.txt ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Map Drive Question
    ... to do is to run thies bat file befoe login to the machine upon startup. ... trying to find out why the Group policy startup script never run. ... when i restart this server i don't see the map drive X. ... You must go to Active Directory Users and Computers, ...
    (microsoft.public.windows.server.general)