Hi all,
Wonder if anyone can shed any light.
I have a script task that kicks off psexec to run a command line app on our App server.
I can run the package in BIDs, all works fine.
Load the package up to SQL server ,run it through SSMS and it works fine
But run the package from a SQL Job and it just hangs.
Some more details:
The account that SQL Server Agent logs in as has full rights to all relevent servers/folders
I have custom logging enabled and it shows all tasks before my script working, then it hits the script and just hangs
In 'Job Activity Monitor' the job is running
Its as though it is waiting for input..
And it is there where I think the problem lies.
I am calling the psexec via a C# process call.
The code that starts the process:
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
//p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.CreateNoWindow = false;
p.StartInfo.FileName = psexecPath;
p.StartInfo.Arguments = _arguements;
p.Start();
p.WaitForExit();
Dts.TaskResult = (int)ScriptResults.Success;
p.Close();
When I run this locally I get 3 cmd type windows but they all disappear as soon as the command completes (the job loops thru 3 files)
I am thinking that if I could logon to the server that the job is running on with the account that SQL Agent runs under I would see a black window with an error msg or a 'hit enter to continue...' :-)
Can anyone see anything obvious
Many thanks
Wonder if anyone can shed any light.
I have a script task that kicks off psexec to run a command line app on our App server.
I can run the package in BIDs, all works fine.
Load the package up to SQL server ,run it through SSMS and it works fine
But run the package from a SQL Job and it just hangs.
Some more details:
The account that SQL Server Agent logs in as has full rights to all relevent servers/folders
I have custom logging enabled and it shows all tasks before my script working, then it hits the script and just hangs
In 'Job Activity Monitor' the job is running
Its as though it is waiting for input..
And it is there where I think the problem lies.
I am calling the psexec via a C# process call.
The code that starts the process:
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
//p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.CreateNoWindow = false;
p.StartInfo.FileName = psexecPath;
p.StartInfo.Arguments = _arguements;
p.Start();
p.WaitForExit();
Dts.TaskResult = (int)ScriptResults.Success;
p.Close();
When I run this locally I get 3 cmd type windows but they all disappear as soon as the command completes (the job loops thru 3 files)
I am thinking that if I could logon to the server that the job is running on with the account that SQL Agent runs under I would see a black window with an error msg or a 'hit enter to continue...' :-)
Can anyone see anything obvious
Many thanks