#JustLEarned3 Identify running jobs on remote server

To identify running jobs in a remote server we can use sp_help_job command in the following way.

1.--Content of sqlQuery.sql
2.exec msdb.dbo.sp_help_job @execution_status = 0
3.--Main Code to execute.
4.sqlcmd.exe -S<servername> -U<username> -P<password> -dmsdb -h-1 -b -i sqlQuery.sql