2

I have a problem with sql server 2012 SSIS package which has execute step running wscript.exe utility.

When I run this package from BIDS everything works fine, when I start package from SSIS it also starts without any problem. But once I start this package as a step in sql agent job - it hangs, and do nothing. The problem is with execute step, once I disable it in package SQL agent executes package fine.

I've tried to add SQL Agent's credentials security rights on folder with wscript.exe utility, I've also tries to add sql server proxy account. But still nothing helped.

Can you please advise how can I fix it?

UPDATE:

Once I run package in Dev Tools everythings works just fine, but running package from sql server job causes wscript.exe process hang in process list in a taskmanager. Once I manually kill this process job stops working.

I assume that this behaviour is somehow related to lack of permissions, but even new credentials didn't work for me. Or maybe wscript utility asks for some promt, though running the same script from command line didn't show any.

1
  • What happens if you run the wscript.exe command through a standalone SQL Agent step (CmdExec)?
    – user507
    Commented Dec 16, 2013 at 13:00

1 Answer 1

3

Without some detail of error messages it is hard to know for sure what's going wrong, however it sounds like it may well be either a permissions issue or a problem running the script on that host.

When an agent job runs, it will run under the agent service account or the credential used to create the proxy that the step runs as.

This means that the account will need permissions on wscript.exe and the script that wscript.exe runs. I think my next step would be to do the following test:

  1. create a new credential using your login
  2. use this credential to create a proxy
  3. run the step of the agent job as this proxy

If this doesn't work, try running the script directly on the host where SQL Server is running - the outcome of this would indicate if there is an issue with the script being able to run from that host

7
  • Please check my update.
    – Johnny_D
    Commented Dec 16, 2013 at 11:46
  • Can you run the script from the server's command line? What happens if you try?
    – TomGough
    Commented Dec 16, 2013 at 12:02
  • If I run package from SSIS services or manually - everything is ok.
    – Johnny_D
    Commented Dec 16, 2013 at 12:04
  • And that's on the server? Just that I've had similar issues in the past where something runs fine from BIDS on my workstation but fails on the server because there is some unresolved dependency on the server
    – TomGough
    Commented Dec 16, 2013 at 13:29
  • Yes, I've opened DevTool on server, to verify that it works. And it did work, when I start it manually.
    – Johnny_D
    Commented Dec 17, 2013 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.