Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to scheduling a query in sql server 2005

Author  Topic 

mrsaif
Starting Member

43 Posts

Posted - 2008-04-16 : 08:20:00
I want to schedule a query that ll insert a record in a table of the database at every 02:00 am. How should i do that. i am uisng sql server 2005?

Muhammad Saifullah

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-16 : 08:40:42
Create a procedure for insert statement and schedule it as job to run at 02:00 am daily

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

mrsaif
Starting Member

43 Posts

Posted - 2008-04-16 : 08:46:31
Thanks madhivanan,
But my question is 'HOW TO SCHEDULE' in 2005. there is no job schedular i fond in sql server 2005?

Muhammad Saifullah
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-16 : 08:54:57
http://technet.microsoft.com/en-us/library/ms191439.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-16 : 08:56:04
http://technet.microsoft.com/en-us/library/ms191439.aspx
Go to Top of Page

mrsaif
Starting Member

43 Posts

Posted - 2008-04-16 : 09:23:36
thank Madhivanan and visakh16,
To schedule a job
In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.

Expand SQL Server Agent, expand Jobs, right-click the job you want to schedule, and click Properties.(I DID NOT FIND "SQL Server Agent" in Object Explorer)

Select the Schedules page, and then click New.

In the Name box, type a name for the new schedule.

Clear the Enabled check box if you do not want the schedule to take effect immediately following its creation.

For Schedule Type, select one of the following:

Click Start automatically when SQL Server Agent starts to start the job when the SQL Server Agent service is started.

Click Start whenever the CPUs become idle to start the job when the CPUs reach an idle condition.

Click Recurring if you want a schedule to run repeatedly. To set the recurring schedule, complete the Frequency, Daily Frequency, and Duration groups on the dialog.

Click One time if you want the schedule to run only once. To set the One time schedule, complete the One-time occurrence group on the dialog.



Muhammad Saifullah
Go to Top of Page

karthi.urs
Starting Member

1 Post

Posted - 2008-06-12 : 07:38:34
Is it possible to schedule the job by Sqlquery?
Instead of creating the Job by manually using Object explorer, i need to create a new job using sql query. This is my requirement. Please help me. Thanks in advance.
Go to Top of Page

MuadDBA

628 Posts

Posted - 2008-06-12 : 11:30:56
Look up sp_create_job in books online.
Go to Top of Page
   

- Advertisement -