use master go --定义创建作业 DECLARE @jobid uniqueidentifier, @jobname sysname SET @jobname = N'testInterval' IF EXISTS(SELECT * FROM msdb.dbo.sysjobs WHERE [email protected]) EXEC msdb.dbo.sp_delete_job @[email protected] EXEC msdb.dbo.sp_add_job @job_nam