USE [Test] GO /****** Object: Trigger [dbo].[trgUpdate] Script Date: 01/28/2013 13:33:47 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER trigger [dbo].[trgUpdate] on [dbo].[Tbl_User_Information] for update as declare @EmpID as int; declare @Field as varchar(50); declare @Action as varchar(50); select @EmpID=i.U_ID from inserted i; if update(FullName) select @Field= (select c.name from syscolumns c join sysobjects o on o.id=c.id where c.name like '%FullName%'); set @Action='Updated'; insert into Test_Table values(@EmpID,@Field,@Action);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)