Question : How to schedule a query or procedure

How to schedule a query or procedure to run every day at 1AM?

Please help me regarding this?

Answer : How to schedule a query or procedure

In Management Studio,

Expand the server tree down to "SQL Server Agent"
Right click on Jobs and select New Job
Give the job a name.
On the "Steps" page, create a new step.
Give that step a name and type your sql query or stored procedure in the "command" field.
Click OK.
On the "Schedules" page, create a new schedule.
Give the schedule a name and set the time and recurrance of when it should run.
Click ok.
Click ok again to save the job.

The specified command will now kick off at the time requested. You can test this job at any time by right clicking on it and selected "Start at step..."
Random Solutions  
 
programming4us programming4us