Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server Agent Scheduled Jobs - Cannot find DLL when invoking executable program Expand / Collapse
Author
Message
Posted Friday, February 11, 2011 1:54 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, May 27, 2014 2:55 PM
Points: 52, Visits: 270
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
Post #1062827
Posted Friday, February 11, 2011 2:38 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 9:12 PM
Points: 1,349, Visits: 2,874
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.
Post #1062841
Posted Friday, February 11, 2011 2:52 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, May 27, 2014 2:55 PM
Points: 52, Visits: 270
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.

Post #1062852
Posted Friday, February 11, 2011 3:35 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 9:12 PM
Points: 1,349, Visits: 2,874
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.
Post #1062873
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse