Execute Process Task

Hi i have  two process tasks. One runs .bat file and other runs.exe files. When i run them  manually they run fine fine but  when i automate them that dosent  give any error but it does not  do what it is  supposed to do. What could be the reson. It shows no errors
svs1919Asked:
Who is Participating?
 
HoggZillaConnect With a Mentor Commented:
Make sure you have SQL Server Agent permissions to execute an exe. Are you using a proxy? Do you have SQL Server Agent User role?
http://social.technet.microsoft.com/Forums/en-US/sqltools/thread/f92b995f-5ef8-4641-9588-5d52667fbae8
 
0
 
HoggZillaCommented:
Are you running the package from your pc or via a SQL Server Agent job?
If the process task does not return an error that means the process (bat or exe) is being executed.
If you run from your PC then you should be able to see the windows dos window popup.
0
 
svs1919Author Commented:
i  am runnign the package using SQL Server Agent.

Yes  when i run from my PC a popup window is seen and the work is  done. But if i automate it  why doesent it  work?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
HoggZillaCommented:
Make sure the SSIS Package contains a path that is visible from the server. Also, make sure the SQL Server user has access to that path as well.
When you view history from the job, what is the detail message?
0
 
svs1919Author Commented:
yes both the files are in c: drive  so they should be easyly accessable
0
 
HoggZillaCommented:
Is that c: reference visible from the server. Send me the history from View History on the SQL Server Agent job.
0
 
svs1919Author Commented:
Here you go
Message
The job succeeded.  The Job was invoked by Schedule 111 (XYZ Test).  The last step to run was step 1 (test).

Message
Executed as user: ABC\sqladm. Microsoft (R) SQL Server Execute Package Utility  Version 9.00.3042.00 for 32-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  4:00:07 AM  DTExec: The package execution returned DTSER_SUCCESS (0).  Started:  4:00:07 AM  Finished: 4:02:01 AM  Elapsed:  113.5 seconds.  The package executed successfully.  The step succeeded.
0
 
HoggZillaCommented:
Can you even tell if the .bat or .exe file is being accessed? My guess is they are not. If you remove them from the directory, does the package still finish successfully? Can you write a file to the same directory - just to prove you can get to that directory? As many times as I have debugged this type of problem it has 90% been a directory / permissions problem.
0
 
svs1919Author Commented:
"If you remove them form the directory" You mean that i should test the package by remob=ving the .bat file and .exe files from the folder they are right now and then try to run the package am i right?
0
 
HoggZillaCommented:
Yes, correct. Remove the .bat and .exe files. See if the package runs the same without them. We need to verify they are being accessed by the SSIS package.
0
 
svs1919Author Commented:
Now after your previous message  i looked at my execute process tasks. I found out that i have to give acive directory path as i dint give active directory path. Then i ran the process task this time my .bat task worked  fine it  brought xls files  from the site. But where as my other process task that is supposed to run .exe file it  dint  run. Any more suggestions?
0
 
HoggZillaCommented:
Stay with permissions and access. What does the exe do, does it need access to another directory?
0
 
svs1919Author Commented:
The exe actually goes into and API and then gets the data from that API and puts it in my SQL table. Connection strings to the API are declared in a .exe.config file
0
 
svs1919Author Commented:
hoggzilla i tried to other alternative. I wrote a .bat file that runs  this .exe file. And called that .bat file in a execute process task. Now when i run it manually it workes but if try to automate it dosn't work. Its not giving any error but its not doing what it has to do
0
 
HoggZillaCommented:
It has to be related to the job running from your PC, with you as the User who invokes the job versus the job running on the Server and having a User invoke the job through the Agent..
In the Job History, who is the job Invoked by?
Message
The job succeeded.  The Job was invoked by User MVCIAD\shogg550.
Does this user have access to every level of the path on the way to the .exe file? [\\server\folder\file.exe]
 
0
 
svs1919Author Commented:
yes it  shows that job was invoked by me. I have  direct access to the folder. And the file is in a common C drive so it is accessable to every one
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.