SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
David-G
David-G
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 279
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
SQLDCH
SQLDCH
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2238 Visits: 3399
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.
David-G
David-G
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 279
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.
SQLDCH
SQLDCH
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2238 Visits: 3399
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search