1、
sp_add_jobschedule    
@job_id  =  @JobID,    
@name  =  N'ff',    
@enabled  =  1,    
@freq_type  =  4,  --每天  
@active_start_date  =  20021212,  --开始日期  
@active_start_time  =  0,  --开始时刻  
@freq_interval  =  1,  --子周期  
@freq_subday_type  =  8,  --单位是小时  
@freq_subday_interval  =  10,  --10小时  
@freq_relative_interval  =  0,    
@freq_recurrence_factor  =  0,    
@active_end_date  =  99991231,  
 @active_end_time  =  235959

解决方案 »

  1.   

    2、declare @a uniqueidentifier
    EXEC sp_add_job @job_name = 'test',@job_id=@a outputselect @a
      

  2.   

    [ @active_start_time = ] active_start_time在 active_start_date 和 active_end_date 之间的任何一天开始执行作业的时间。active_start_time 的数据类型为 int,默认设置为 000000,该值表示 24 小时制的上午 12:00:00,并且必须使用格式 HHMMSS 进行输入。
      

  3.   

    --下面的方法就可以得到创建的作业的iddeclare @job_id uniqueidentifier
    exec msdb..sp_add_job @job_name='数据处理',@job_id= @job_id OUTPUTselect 创建的作业id=@job_idexec msdb..sp_delete_job @job_name='数据处理'
      

  4.   

    job_id 是uniqueidentifier型,而不是int型.
      

  5.   

    1、如何定义job的启动时间:--创建调度
    EXEC msdb..sp_add_jobschedule @job_name = '数据处理', 
       @name = '时间安排',
       @freq_type = 4,  --每天
       @freq_interval = 1, --每天执行一次
       @active_start_time = 113345 --0点执行
    不能执行应该是你没有SQL Agnet服务吧?