I have sql server 2005 and need to create trigger for insert query.
I have Table naemd as "Log" with column named as UserID,UserName,LogDate,LogTime and want to transfer data into other table named as "DataTable" with same column name.
I have created trigger
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[Transfer] on [dbo].[Log]
AFTER INSERT
AS
BEGIN
insert into DataTable (UserID,UserName,LogDate,LogTime)
SELECT UserID,UserName,LogDate,LogTime
FROM Log where UserID not in(select UserID from DataTable)
END
New Data is updated on daily basis in "Log" table and so i want to transfer new data from Log table to DataTable with trigger.Execution time is very high and so no output .