Variation of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=194108 Thank you TG for the information.What I want is a record for only the changed column.The following gives me one record for each column in table #Columns (as requested in original post).USE Temp_DJJ;GOALTER TRIGGER trig_MyTable_Update ON MyTableAFTER UPDATE AS BEGIN SET NOCOUNT ON; IF OBJECT_ID('tempdb..#Columns') IS NOT NULL DROP TABLE #Columns; CREATE TABLE #Columns (SubjectColumn VARCHAR(50)); INSERT INTO #Columns VALUES -- I have many more columns (Not a table I created) ('[MyColumn1]'),('[MyColumn2]'),('[MyColumn3]'),('[MyColumn4]'),('[MyColumn5]'),('[MyColumn6]'); INSERT INTO Temp_DJJ.dbo.P2_TriggerLog ( CreateDate, UserId, ServerName, ProcessName, Workstation, DatabaseName, TableName, FieldName, OldVal, NewVal, Key1Name, Key1Val) SELECT GETDATE(), SYSTEM_USER, @@ServerName, APP_NAME(), HOST_NAME(), 'MyDatabase', 'MyTable' , cols.subjectColumn , CASE WHEN cols.SubjectColumn = '[MyColumn6]' THEN d.[MyColumn6] END , CASE WHEN cols.SubjectColumn = '[MyColumn6]' THEN i.[MyColumn6] END , 'RefNum', D.RefNum FROM inserted i INNER JOIN deleted d ON i.RefNum = d.RefNum INNER JOIN #Columns cols ON COALESCE(i.[MyColumn6], 'NULL') <> COALESCE(d.[MyColumn6], 'NULL') WHERE COALESCE(i.[MyColumn6], 'NULL') <> COALESCE(d.[MyColumn6], 'NULL');ENDGO
The WHERE clause is my try at getting only one record created (not six). I should know how to do this but ...Thanksdjj