Solved

How to schedule sql update query

Posted on 2010-08-26
17
440 Views
Last Modified: 2012-05-10
what is the best way to schedule a SQl update query
0
Comment
Question by:dougdog
  • 6
  • 6
  • 3
  • +1
17 Comments
 
LVL 9

Accepted Solution

by:
Tomas Valenta earned 250 total points
Comment Utility
by job in SQLAgent (SQL Management Studio)
0
 
LVL 3

Expert Comment

by:sasi_kmr
Comment Utility
put the query in sql format and save it has batch file.

scheduler it in task scheduler.


thanks,
$a$i
0
 
LVL 19

Assisted Solution

by:Bhavesh Shah
Bhavesh Shah earned 250 total points
Comment Utility

Complete Info on Schduling SQL Query via Job

http://msdn.microsoft.com/en-us/library/ms191439.aspx
0
 

Author Comment

by:dougdog
Comment Utility
u mean just copy the query and paste in into notepad and save it as a .bat
0
 
LVL 3

Expert Comment

by:sasi_kmr
Comment Utility
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
 
LVL 19

Expert Comment

by:Bhavesh Shah
Comment Utility
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
 
LVL 19

Expert Comment

by:Bhavesh Shah
Comment Utility

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

If query contain some crucial information,is it BEST solution to use?
0
 

Author Comment

by:dougdog
Comment Utility
can it report everyday if it runs
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

Author Comment

by:dougdog
Comment Utility
when i click new job where do i enter the sql script
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
Comment Utility
When you creating new job,

you need to create steps.where you need to wrote your sql query.
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
Comment Utility

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
 

Author Comment

by:dougdog
Comment Utility
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
 
LVL 9

Expert Comment

by:Tomas Valenta
Comment Utility
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
 
LVL 9

Expert Comment

by:Tomas Valenta
Comment Utility
under Operators tab create operator and then this is visible in dropdown list in Notification
0
 

Author Comment

by:dougdog
Comment Utility
im setting up the database mail now is it safe to restart sql agent live
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
Comment Utility
do it with permission of your dba.
if its development environment then i dont think there should be any issue.
0
 

Author Closing Comment

by:dougdog
Comment Utility
excellent
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now