Forum
Selam arkadaşlar
SQL2000 de otomatik olarak haftanın hergünü job oluşturmak istiyorum.Bunu manuel olarak değilde SQLcümlesi ile oluşturmak istiyorum.Nasıl yapabilirim.Teşekkürler.
Mehmet Akif
Daha detaylı bilgi sql server boks online
Önce job ekle
Sp_add_job
Syntax
sp_add_job [ @job_name = ] 'job_name'
[ , [ @enabled = ] enabled ]
[ , [ @description = ] 'description' ]
[ , [ @start_step_id = ] step_id ]
[ , [ @category_name = ] 'category' ]
[ , [ @category_id = ] category_id ]
[ , [ @owner_login_name = ] 'login' ]
[ , [ @notify_level_eventlog = ] eventlog_level ]
[ , [ @notify_level_email = ] email_level ]
[ , [ @notify_level_netsend = ] netsend_level ]
[ , [ @notify_level_page = ] page_level ]
[ , [ @notify_email_operator_name = ] 'email_name' ]
[ , [ @notify_netsend_operator_name = ] 'netsend_name' ]
[ , [ @notify_page_operator_name = ] 'page_name' ]
[ , [ @delete_level = ] delete_level ]
[ , [ @job_id = ] job_id OUTPUT ]
This example creates a job named Ad hoc Sales Data Backup that notifies janetl (by pager, e-mail, or network pop-up message) if the job fails, and deletes the job upon successful completion.
USE msdb
EXEC sp_add_job @job_name = 'Ad hoc Sales Data Backup',
@enabled = 1,
@description = 'Ad hoc backup of sales data',
@owner_login_name = 'janet1',
@notify_level_eventlog = 2,
@notify_level_email = 2,
@notify_level_netsend = 2,
@notify_level_page = 2,
@notify_email_operator_name = 'janet1',
@notify_netsend_operator_name = 'janet1',
@notify_page_operator_name = 'janet1',
@delete_level = 1
Daha sonra job Schedule yap
Sp_add_jobschedule
Syntax
sp_add_jobschedule [ @job_id = ] job_id, | [ @job_name = ] 'job_name',
[ @name = ] 'name'
[ , [ @enabled = ] enabled ]
[ , [ @freq_type = ] freq_type ]
[ , [ @freq_interval = ] freq_interval ]
[ , [ @freq_subday_type = ] freq_subday_type ]
[ , [ @freq_subday_interval = ] freq_subday_interval ]
[ , [ @freq_relative_interval = ] freq_relative_interval ]
[ , [ @freq_recurrence_factor = ] freq_recurrence_factor ]
[ , [ @active_start_date = ] active_start_date ]
[ , [ @active_end_date = ] active_end_date ]
[ , [ @active_start_time = ] active_start_time ]
[ , [ @active_end_time = ] active_end_time ]
Examples
This example assumes the job NightlyBackup has been created to back up a database. It adds the job to the schedule with the name ScheduledBackup and executes every day at 1:00 A.M.
USE msdb
EXEC sp_add_jobschedule @job_name = 'NightlyBackup',
@name = 'ScheduledBackup',
@freq_type = 4, -- daily
@freq_interval = 1,
@active_start_time = 10000
eyvallah dostum oluşturdum..Şuan da çalışıyorrr..tşk..