Thanks for ScottPletcher but now I am running into another issue that I am not sure why. I have two tables, first one is the Primary table and the other is PrimaryHist table. I added a new column LineCount to both tables and I am now trying to create the Trigger but I get an error.
CREATE OR ALTER TRIGGER dbo.trSyncPrimaryHist_Update
INSERT INTO dbo.PrimaryHist
FROM INSERTED AS i
CROSS JOIN sys.dm_exec_sessions AS s
WHERE s.session_id = @@SPID;
Msg 207, Level 16, State 1, Procedure trSyncPrimaryHist_Update, Line 9 [Batch Start Line 0]
Invalid column name 'LineCount'.
Again LineCount exists in both tables and when I query sys.dm_exec_sessions none of the columns exist within it. So how do I get this new column to be associated with sys.dm_exec_sessions if I cannot add it into the Trigger.
I can query and update both tables for the column and it shows but I cannot get the creation of the Trigger to not deny it saying it is an Invalid Column?? I cannot even use the old school version as I get the same error??