I have migrated SQL JOB from SQL2005 to SQL2008, as below
THe step description as below
IF EXISTS (SELECT * FROM someTable)
Exec master..xp_cmdshell "'c:\mypath\someExecutable.exe'"
this someExecutable.exe shoule create 4 image files and 1 word file. if I run this executable from Command Prompt it is working fine.
But if i run the same someExecutable.exe' through a SQL JOB, it is just creating 4 image files but not creating WORD document.
Dont understand why.. actually this job is migrated from SQL 2005 and its working fine there.
it looks like i may require some permission related thing with the executable or OFFICE.
Please provide the solution, i know it's confusing.
Thanks in advance
1. Get rid of xp_cmdshell. You don't need it here.
Job step 1, T-SQL: write the SQL to raise error when no rows exist. In the 'on success' of the job step say 'go to next step' and in the 'on fail' say 'quit job with success'.
Job Step 2, CmdExec: run the executable. On success say 'quit job with success', and on fail say 'quit job with failure.'
As for the executable, do you receive an error when you run it through the job? I assume Word is installed correctly because you said when you run it from the command line it completes successfully. Is the SQL Server 32-bit or 64-bit and did that change from 2005 to 2008? Another thing to check is whether your executable can handle running under 64-bit in case that changed. Some of the Office objects only run under 32-bit.
__________________________________________________________________________________________________There are no special teachers of virtue, because virtue is taught by the whole community. --Plato