Hey Guys!
I have a SQL Update Query that I want to run automatically everyday andI have read through the posts and I do not understand very clearly howto go about creating one.
The SQL query I want to run is this:
UPDATE Rental
SET TotalFee = ExtraFee + TotalFee
WHERE DaysOverdue >= 0
Once I have made a DTS package. How do I declare it in my coding?
Thanks in advance!
If you have access to add a job in SQL Agent, you can create a job and just run the query. You don't need DTS at all. If you don't have access to create a new job, then you'll have to do something outside of SQL using a different scheduling mechanism. Either way, there's no need for DTS to run a query like this. DTS is more for importing and/or exporting data and objects. Even if you did it in DTS, it's the SQL Agent service you'd use to create and schedule a job to run the DTS package.|||I never knew that there was another way of scheduling a SQL task.
I have tried to create a SQL Agent Task by going to Management >> SQL Server Agent >> Jobs
But for some reason it is not working even through I have scheduled a job so that it will run the query automatically.
I tested the SQL Agent Job by right clicking over my job and selecting 'Start Job'. Then an error occurs:
error 22022SQLServerAgent is not currently running so it cannot be notified forthis action
So how do i go about running it?
|||You have to start the Agent service. Once that's running, it will run the job on the schedule you define. Refer to Books on Line for more details on the Agent service.|||It works now!
Thanks!
sql
No comments:
Post a Comment