Home Forums Programming Connecting Execute a sql job from AS400 command line RE: Execute a sql job from AS400 command line

  • Thanks. We got it to work. We used the RMTCMD command to call a .bat. The main issue is that we had to use OSQL instead of sqlcmd which is weird because we are on SQL 2005.

    This is the .bat

    osql -U sqluser -P sqlpassword -S server -Q "EXEC msdb.dbo.sp_start_job N'JOB NAME'" .

    Also we has to change the user and password for the RMTCMD because it is different than the sql user and password.

    Thanks for your help.