Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Si applica a:SQL Server
Istanza gestita di Azure SQL
Important
In Azure SQL Managed Instance, sono attualmente supportate la maggior parte, ma non tutte, le funzionalità di SQL Server Agent. Per informazioni dettagliate, vedere differenze T-SQL tra Istanza gestita di SQL di Azure e SQL Server.
This topic describes how to stop a Microsoft SQL Server Agent job. Un processo è una serie specificata di azioni eseguite da SQL Server Agent.
Before you begin: ,
To stop a job, using:
Prima di iniziare
Limitazioni e restrizioni
If a job is currently executing a step of type CmdExec or PowerShell, the process that is being run (for example, MyProgram.exe) is forced to end prematurely. This can cause unpredictable behavior, such as files that are being used by the process being held open.
For a multiserver job, a STOP instruction for the job is posted to all target servers of the job.
Sicurezza
Per informazioni dettagliate, vedere Implementare la sicurezza di SQL Server Agent.
Uso di SQL Server Management Studio
To stop a job
In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
Expand SQL Server Agent, expand Jobs, right-click the job you want to stop, and then click Stop Job.
If you want to stop multiple jobs, right-click Job Activity Monitor, and then click View Job Activity. In the Job Activity Monitor, select the jobs you want to stop, right-click your selection, and then click Stop Jobs.
Uso di Transact-SQL
To stop a job
In Object Explorer, connect to an instance of Database Engine.
Sulla barra Standard fare clic su Nuova query.
Copiare e incollare l'esempio seguente nella finestra Query, quindi fare clic su Esegui.
-- stops a job named Weekly Sales Data Backup USE msdb ; GO EXEC dbo.sp_stop_job N'Weekly Sales Data Backup' ; GO
For more information, see sp_stop_job (Transact-SQL).
Utilizzo degli oggetti di gestione di SQL Server
To stop a job
Call the Stop method of the Job class by using a programming language that you choose, such as Visual Basic, Visual C#, or PowerShell. Per altre informazioni, vedere SQL Server Management Objects (SMO).