hi every body can some help me to write sql trigger query I have to tables
table_1 with the columns of id, field1, fieldtext1
and
table_2 with the columns of id, fieldtext2, fieldtext3
i made a query
*********************************************************************************
/****** Object: Trigger [dbo].[trTable2_Change] Script Date: 04/10/2013 15:58:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[trTable2_Change] ON [dbo].[Table_2] AFTER INSERT, UPDATE
AS
UPDATE Table_1
SET
Field1 = I.fieldtext2
FROM Table_1 INNER JOIN Inserted I ON Table_1.ID = I.ID
*********************************************************************************
this is changing a fieldtext2 when i update the field1 but i want other fields as well to be updated like fieldtext3 and fieldtext4
so kindly help me for this
thanks
table_1 with the columns of id, field1, fieldtext1
and
table_2 with the columns of id, fieldtext2, fieldtext3
i made a query
*********************************************************************************
/****** Object: Trigger [dbo].[trTable2_Change] Script Date: 04/10/2013 15:58:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[trTable2_Change] ON [dbo].[Table_2] AFTER INSERT, UPDATE
AS
UPDATE Table_1
SET
Field1 = I.fieldtext2
FROM Table_1 INNER JOIN Inserted I ON Table_1.ID = I.ID
*********************************************************************************
this is changing a fieldtext2 when i update the field1 but i want other fields as well to be updated like fieldtext3 and fieldtext4
so kindly help me for this
thanks