Create trigger Trigger_Name ON Table_Name
FOR UPDATE
AS
DECLARE @Now_date date=getdate();
DECLARE @Updated_date date;
select @Updated_date =i.doj from inserted i;
if(DATEDIFF(yy,@Updated_date ,@Now_date ) >= 5)
UPDATE Table_Name set Column_Name=Value where id=1;
PRINT 'AFTER UPDATE Trigger fired.'
GO
UPDATE test set doj='5/5/2000'
http://codedisplay.com/dynamically-runtime-bind-data-into-crystal-report-using-asp-net-c-vb-net/
FOR UPDATE
AS
DECLARE @Now_date date=getdate();
DECLARE @Updated_date date;
select @Updated_date =i.doj from inserted i;
if(DATEDIFF(yy,@Updated_date ,@Now_date ) >= 5)
UPDATE Table_Name set Column_Name=Value where id=1;
PRINT 'AFTER UPDATE Trigger fired.'
GO
UPDATE test set doj='5/5/2000'
http://codedisplay.com/dynamically-runtime-bind-data-into-crystal-report-using-asp-net-c-vb-net/
No comments:
Post a Comment