How to schedule sql update query

what is the best way to schedule a SQl update query
dougdogAsked:
Who is Participating?
 
Tomas ValentaIT ManagerCommented:
by job in SQLAgent (SQL Management Studio)
0
 
sasi_kmrCommented:
put the query in sql format and save it has batch file.

scheduler it in task scheduler.


thanks,
$a$i
0
 
Bhavesh ShahLead AnalysistCommented:

Complete Info on Schduling SQL Query via Job

http://msdn.microsoft.com/en-us/library/ms191439.aspx
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
dougdogAuthor Commented:
u mean just copy the query and paste in into notepad and save it as a .bat
0
 
sasi_kmrCommented:
copy the query and save it as .sql file.

then put the sql file in a .bat file and put it in the task scheduler.

thanks,
$a$i
0
 
Bhavesh ShahLead AnalysistCommented:
Hi,

Task Schduler can be opend by any one....

Plus he need to put command inside bat file

When Microsoft SQL SERVER HAVING JOB Facility then why should we go for task schduler?

Please explain SASI
0
 
Bhavesh ShahLead AnalysistCommented:

Moreover, if query execution fails, will task schudler give you log?

If query contain some crucial information,is it BEST solution to use?
0
 
dougdogAuthor Commented:
can it report everyday if it runs
0
 
dougdogAuthor Commented:
when i click new job where do i enter the sql script
0
 
Bhavesh ShahLead AnalysistCommented:
When you creating new job,

you need to create steps.where you need to wrote your sql query.
0
 
Bhavesh ShahLead AnalysistCommented:

Please chect out this link.
This will guide you step by step.

http://www.dailycoding.com/Posts/step_by_step_guide_to_add_a_sql_job_in_sql_server_2005.aspx
0
 
dougdogAuthor Commented:
ok got it how can i get it to email me when job fails and when job completes
i can see email tab but cant enter address
0
 
Tomas ValentaIT ManagerCommented:
create job by SQL Management Studio/SQL Server Agent/Jobs, here create new one, sql commands add to the Step section, then you can create schedule, alerts, notification, what you want.
0
 
Tomas ValentaIT ManagerCommented:
under Operators tab create operator and then this is visible in dropdown list in Notification
0
 
dougdogAuthor Commented:
im setting up the database mail now is it safe to restart sql agent live
0
 
Bhavesh ShahLead AnalysistCommented:
do it with permission of your dba.
if its development environment then i dont think there should be any issue.
0
 
dougdogAuthor Commented:
excellent
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.