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
 Old Forums
 CLOSED - General SQL Server
 Automatic Update of tables based on date

Author  Topic 

jmr
Starting Member

5 Posts

Posted - 2006-03-19 : 20:29:43
I am new to sql server,

I need to be able to have a trigger or something trigger an event to update some tables every day at let say 12:00 pm. The trigger will then check a table for the end date and if it is = then begin to move information around. Does anybody know how to do this, or if it is possible. I have not been able to find anywere were I can do this. I don't know triggers very well and am not sure if this can be done with that.


Please Help!!!!

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-19 : 20:33:46
You don't need trigger. Trigger is executed on the event of INSERT, UPDATE or DELETE action on a table.

You can perform what you required in a Stored Procedure and have that stored procedure scheduled it to run a every day at 12:00 PM.



KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

jmr
Starting Member

5 Posts

Posted - 2006-03-19 : 20:38:47
How do I schedule this to run every day? Do I do it threw the Sql agent jobs, if so how do I do it when my server is hosted on another site?
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-19 : 20:43:55
"How do I schedule this to run every day?"
You can scheduled it via Enterprise Manager.

"how do I do it when my server is hosted on another site?"
Register the remote server in your local Enterprise Manager and managed it from your local




KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

jmr
Starting Member

5 Posts

Posted - 2006-03-19 : 20:48:32
Do I schedule it with the Sql Server Agent?
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-19 : 20:55:24
yes. Management - SQL Server Agent - Jobs



KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

jmr
Starting Member

5 Posts

Posted - 2006-03-19 : 21:01:48
Thank you,
How would I call a stored Procedure named "Daily Check". Should I use the activeX Script for the step type and use Visual basics to call the stored procedure?
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-19 : 21:16:47
When you create a new job, under the Steps tab page, use TSQL and enter under command
exec your_stored_procedure



KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

jmr
Starting Member

5 Posts

Posted - 2006-03-19 : 21:27:29
Thanks!
I will try that
Go to Top of Page
   

- Advertisement -