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)
 Automatically Run Query at 5:30pm everday

Author  Topic 

mayurcreation
Starting Member

16 Posts

Posted - 2008-01-22 : 16:45:19
Hi all,

I need to write a procedure to insert data into table automatically at 5:30pm every day.

e.g.
TB: ABC
Col1, Col2, Col3
......
......
......

At 5:30pm every day everything from TB ABC should be inserted into TB XYZ.

This should be automated process in SQL Server 2005

Any help will be highly appreciated.

Thanks
Mayur

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-01-22 : 17:01:20
As far as the scheduling goes you can create a Sql Job. You can schedule the job to run on a variety of schedules including daily at 5:30 PM.

The job will call your stored procedure. So the procedure doesn't need to know about when it is called, it just does the insert.

Is that enought for you to go on or do you need more specific help with either of those steps?

Be One with the Optimizer
TG
Go to Top of Page

jdaman
Constraint Violating Yak Guru

354 Posts

Posted - 2008-01-22 : 17:02:02
Look up "Sql Server Agent Create Job" in msdn.
Go to Top of Page

mayurcreation
Starting Member

16 Posts

Posted - 2008-01-22 : 17:11:56
Thanks TG

How to create a Sql Job?

Any short example do you have.

Thx
Mayur

quote:
Originally posted by TG

As far as the scheduling goes you can create a Sql Job. You can schedule the job to run on a variety of schedules including daily at 5:30 PM.

The job will call your stored procedure. So the procedure doesn't need to know about when it is called, it just does the insert.

Is that enought for you to go on or do you need more specific help with either of those steps?

Be One with the Optimizer
TG

Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-01-22 : 18:14:48
I just basically did what jdaman suggested:
http://technet.microsoft.com/en-us/library/ms190268.aspx

Be One with the Optimizer
TG
Go to Top of Page

mayurcreation
Starting Member

16 Posts

Posted - 2008-01-23 : 11:16:30
Thanks to all.

This link was helpfull to me : - http://www.quackit.com/sql_server/tutorial/sql_server_agent_jobs.cfm
Go to Top of Page
   

- Advertisement -