SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 manually scheduling a job
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

swathi3003
Starting Member

20 Posts

Posted - 10/31/2013 :  02:35:28  Show Profile  Reply with Quote
hi
Can i schedule a job manually.?? like i have a job that will be run every month on 'x' date..
is it possible to give 'x' from front end??

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 10/31/2013 :  02:43:42  Show Profile  Reply with Quote
its possible
Get x from front end screen using .net code pass it to db code. In DB, execute sp_add_jobschedule to set schedule based on the passed value

http://technet.microsoft.com/en-us/library/ms366342.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

swathi3003
Starting Member

20 Posts

Posted - 10/31/2013 :  03:12:26  Show Profile  Reply with Quote
Thank U


actually i have a doubt

i pass the day from front end
and i hae written below code from backend

declare @day int = 19

EXEC msdb.dbo.sp_add_jobschedule @job_id=@job_id, @name=N'sch1',
@enabled=1,
@freq_type=16,
@freq_interval=@day,
@freq_subday_type=1,
@freq_subday_interval=0,
@freq_relative_interval=0,
@freq_recurrence_factor=1,
@active_start_date=20131031,
@active_end_date=99991231,
@active_start_time=0,
@active_end_time=235959,
@schedule_uid=N'72fc1ed3-e3b6-4289-a0dd-19a1fe7aaa33'


will it automatically updated to that job??
and the next time if i update the day
then what happen ??
Go to Top of Page

swathi3003
Starting Member

20 Posts

Posted - 10/31/2013 :  03:24:38  Show Profile  Reply with Quote
Can i update systables data from my application

like [msdb].[dbo].[sysjobschedules] has job schedule dates
what if i update next date?? then the job will be run on given date...

Im not sure whether it is suggestable or secured..

Im just asking..
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000