Click here to Skip to main content
16,016,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
<bjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj>
Posted

1 solution

First you create a reminder table here you can insert the records for reminder on Insertion of each record in your master table. The reminders you can call on timer so it will populate.


SQL
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE TRIGGER Trigger1 --This is your trigger name
   ON  sales  --This is your master table
   AFTER INSERT --DELETE/UPDATE (Anyone action you can choose)
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for trigger here
insert into table_2(test1) values(dateadd(day,10,getdate())) -- The reminder table where you can insert your message
END
GO 
 
Share this answer
 
v2
Comments
Member 10610791 21-Feb-14 1:12am    
its not working yaar..
Can u please briefly describe that code.
i cant understand which field i take in reminder table?
Member 10610791 21-Feb-14 1:28am    
And i can also not understand that line:"insert into table_2(test1) values(dateadd(day,10,getdate()))"
sohail awr 21-Feb-14 8:19am    
First Select your table from your database in which you want to set trigger.

--- Trigger works on each record

I have defined Trigger Name as Trigger1
My Master table is Sales (You can use your master table)
Event I have used (AFTER/BEFORE) any one you can use.
Make a new Reminder Table as Table_2 or any name you can give, Entity Name I have given as 'test1' you can use any other name.
In values I have used DateAdd function. 1 parameter is Day , how much day you want to add, your invoice date I used default system date

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