Results 1 to 10 of 10

Thread: Execute process task - doesn't run exe

  1. #1
    Join Date
    Mar 2010
    Posts
    5

    Execute process task - doesn't run exe

    Hi,

    I am currently developing completely on a local machine and have a DTS package that on completion should run a local exe file that compresses the csv files that were just imported.

    If I run the package in the designer or directly then all is fine and the files are compressed.

    If I run the file from SQL Agent as a scheduled task or manually start the task then the DTS runs fine and completes successfully but the files are not compressed.

    I also tried pointing the step at a basic bat file that deletes the csv files. This doesn't run either.

    I don't think there are any network access issues as everything is running from local disks and the data is imported from the same directory as where I want to run the exe.

    I have tried running my SQLSERVERAGENT service as .\Administrator and also as Local Service Account without success.

    Any pointers on how to achieve running a simple exe or bat file would be greatly appreciated.

    Thanks,

    Matt

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Tried start sql agent with local system? Who's job owner? Is it sysadmin?

  3. #3
    Join Date
    Mar 2010
    Posts
    5
    Hi, thanks for the reply. The job owner is sa

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Tried run .exe in job step directly?

  5. #5
    Join Date
    Mar 2010
    Posts
    5
    Yep - i've tried running the step in the designer, running the package from the designer and running the package from the list of packages in SQL management software.

    The only time it doesn't work is when the DTS is initiated from the SQL Agent list - either manually or as a scheduled job.

    As it is all local, and the data is imported from the same directory as the exe file I don't think that it is an issue with DTS not being able to find the exe.

    I am guessing that it comes down to a permissions issue with SQL Server Agent user but that is using the local admin account currently so I don't know why there would be a permissions issue.

    Has anyone successfully got a DTS package to run an exe or bat file?

    Thanks

  6. #6
    Join Date
    Sep 2002
    Posts
    5,938
    Again, did you try run .exe along in sql job step outside of package?

  7. #7
    Join Date
    Mar 2010
    Posts
    5
    I think I must have misunderstood you.

    I have set up a new SQL job, with a type of "Operating System Command (CmdExec)" and in the Command window I have entered the full path to the exe. Is this what you were suggesting?

    I tried running the job and nothing happened. Tried the exact same command in the Run command and the files were processed.

    Thanks

  8. #8
    Join Date
    Sep 2002
    Posts
    5,938
    That means sql agent is unable to handle that .exe, you can't run interactive program in sql job. Winzip has dos addin that works in sql job.

  9. #9
    Join Date
    Mar 2010
    Posts
    5
    Thanks for your help

    Ill investigate options to rewrite my .Net console app to not be interactive. I guess changing it to a winforms app with no forms might work.

    Thanks again

  10. #10
    Join Date
    Sep 2002
    Posts
    5,938
    Good Luck and Happy SQLing.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •