Click here to Skip to main content
15,944,959 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody,
I have written a trigger for a table, but i want to execute that when the system date is equal to the date that given.

I know trigger can work in insert, update, delete.
So is there any possible way to execute the trigger with the date check.Please help me.

Thanking you.
Posted

No, there's not. You'd have to write a service or something else to check the date.
 
Share this answer
 
Comments
vpmanu 22-Jul-10 5:01am    
Thank you for your reply, and can i do it by using sql jobs?,But i dont have any idea about sql jobs, so please provide me some idea about sql jobs, ie creation and execution and all.

Thanking you
Trigger word itself says that something happens when a certain event occurs. In DB world it can be, Insert, Update or Delete.

Based on your condition, they are not related to either of the three events that can call a trigger. Thus, it would not be called.
As suggested by CG, you need to have a Windows Service or some kind of Scheduler that will check for the specified condition and execute certain queries.
 
Share this answer
 
Please think about an SQL Server JOB, instead of Triggers, when may help you to resolve your challenge
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900