How do I turn a query in SQL Server 2005 into a procedure that can run automatically like an .exe on a task scheduler?

How do I turn a query in SQL Server 2005 into a procedure that can run automatically similar to an .exe on a Windows task scheduler?
mycoal_2006Asked:
Who is Participating?
 
Ryan McCauleyData and Analytics ManagerCommented:
You can create a SQL Agent Job (SQL Server's equivalent to the Windows Task Scheduler, but used for database-related tasks that need to happen regularly) and schedule that to run on any interval you like. Here's a walk-through:

http://www.dailycoding.com/Posts/step_by_step_guide_to_add_a_sql_job_in_sql_server_2005.aspx

The images and server shown are for SQL 2005, but the process is unchanged between 2005/2008/2008R2.
0
 
gdupadhyayCommented:

You can't create exe file for any scripts. So you have to find other way:

Here is my opinion:
You need to create a console project.  Make connection with DB, Open connection and execute stored procedure.  Generate the exe of the console application.

Let me know for any question.
0
 
mycoal_2006Author Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.