#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
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s