SQL Server Agent Scheduled Jobs - Cannot find DLL when invoking executable program

  • Hi,

    I am testing database migration from SQL Server 2000 to SQL Server 2005. It's SQL Server 2005 64-bit running on Windows Server 2003 64-bit OS.

    I have a SQL Server Agent job that copies data from all different sources, and at the last step it will invoke a Win32 executable to process the data. I have set up the OS Environment and Windows registry, and I have no problem running the executable manually or through Windows Scheduler.

    However, when running the SQL Server Agent scheduled job, the job hangs. When I check Event Viewer, it says "Unable To Locate Component : This application has failed to start because xxx.dll was not found.". In fact, the xxx.dll is right under the same folder.

    The user running SQL Server and Agent is in the local administrator group. If I log in to the server as this user, I have no problem running the executable manually.

    Does anyone have any idea why this is happening? Is this SQL Server issue or Windows Server issue?

    Any help will be very appreciated!

    David

  • This is a total shot in the dark, so do some research before, but maybe the .dll isn't registered.

    You could modify the account that the SQL Server agent is running as to allow it to login, then login and run 'procexp' (download from live.sysinternals.com). Try and run your job manually, 'procexp' will show you the .dlls being used, and will also show the environment variables.

    ----------------------------------------------------------------------------
    Sacramento SQL Server users group - http://sac.sqlpass.org
    Follow me on Twitter - @SQLDCH
    ----------------------------------------------------------------------------

    Yeah, well...The Dude abides.
  • Thanks for your quick reply!

    I just don't understand what the difference is between manually running the .exe file and invoke the .exe file from SQL Serevr Agent. As I mentioned in the last post, if I run it manually, there was no problem. If I run it through Windows Scheduler, there was no problem either. Which means somehow the OS can locate the dlls under certain scenarios. But why it doesn't work for SQL Server Agent?

    BTW, we are running SQL Server 2000 32-bit under Windows Server 2003 32-bit on a 64-bit IBM server, there is no problem at all. Now the what I am wondering is where the problem possibly is.

  • It probably has something to do with a 32bit library vs. a 64bit library. 'procexp' might show you that.

    Curious, why are you going to SQL Server 2005? You're losing support in April, my opinion would be to upgrade to one of the 2008 flavors (if that's an option).

    Another shot in the dark...when you set the owner of the SQL Server Agent service, did you use the SQL Server Configuration manager? When done thru that interface, it creates the necessary Windows groups and add those groups to the necessary Local Security Policy's. Since you said you modified the registry, I'm assuming you followed something like:

    http://support.microsoft.com/kb/283811

    Maybe double check that setup?

    ----------------------------------------------------------------------------
    Sacramento SQL Server users group - http://sac.sqlpass.org
    Follow me on Twitter - @SQLDCH
    ----------------------------------------------------------------------------

    Yeah, well...The Dude abides.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply