Want to learn more about how having an experienced Sage partner can help your business?
There is often a need for end-users to run SQL Jobs on an ad-hoc basis. This creates a security issue because we don't want to install SQL Server Management Studio on the end-user workstation and we don't want to give out Remote Desktop access to the SQL Server or grant additional security within SQL.
Here is a quick process that solves these issues and allows an end-user to run a SQL Server Agent Job from a Windows BAT file on their workstation:
ECHO Executing job
ECHO.
CD C:Program FilesMicrosoft SQL Server100ToolsBinn
osql -S "[SQL SERVER NAME]" -E -Q"exec msdb.dbo.sp_start_job '[SQL JOB NAME]'"
ECHO Job execution completed
pause
CLS
EXIT
NOTE: the BAT file will return a successful message indicating the job was started. It doesn't tell you if the job had errors. An administrator on SQL still needs to monitor the jobs for errors.
Want to learn more about how having an experienced Sage partner can help your business?