Click here to Skip to main content
15,889,878 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi

I have a table called "UserInfo" which contain a column "endVipDate" and "VIP". The column endVipDate will store further date for example 27/1/2016 so i want to create a trigger or stored procedure to check daily if the date into endVipDate is match today date then change the value into VIP to Null or NO. So can some one help me with this please.

Please check this clip that can explain more about the issue
Posted
Comments
Maciej Los 27-Oct-15 16:14pm    
Date is a date and nothing else! You cannot change its value into 'NO' or 'VIP'.
Member 10690878 27-Oct-15 16:21pm    
Dear I did not ask to change the date, i wish if you can re-read the post i want the stored procedure to check the endVipDate for those people whose have the value "YES" into column VIP then if the endVipDate is matching today date then change the value into VIP column to to NO or Null

1 solution

you should created a trigger.
such as
SQL
CREATE TRIGGER trgAfterUpdate ON [dbo].[Employee_Test]
FOR UPDATE
AS



Triggers -- SQL Server[^]
 
Share this answer
 
Comments
Member 10690878 27-Oct-15 16:36pm    
Hi @Member 11193337 thanks for your reply, and i will be more thanks for you if you complete the trigger as those tree line of codes its easy to create it but i need some one to help me in the rest of the trigger. As i need some one to help me to create this trigger as the i am looking for

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