[ACCEPTED]-Looking for T-SQL scripts to delete a SQL Job-sql-server-agent
USE msdb; GO EXEC sp_delete_job @job_name = N'NightlyBackups' ; GO
You're looking for
[srv].[master].[dbo].sp_delete_job @job_name = 'MyJob'
So this four part name 4 only works with linked servers. Otherwise, you'll 3 have to connect to the server, and run that 2 command against it (with everything right 1 of
It's worth noting that you can just use 4 SSMS, choose the job, right-click and pick 3 "Delete", and then use the Script button 2 at the top of the dialog box to generate 1 a script like the ones suggested here.
More Related questions