I am really new to sql server and the whole trigger concept and I am running into some issues. What I am trying to do is create a trigger that updates the current_workitem table with the current information after a new record is inserted into the workitemhistory table . Not sure if I am even close. Is there a good example I could look at to help give me some direction?
ALTER TRIGGER [CMSC].[WorkItem_UPD] ON [CMSC].[WorkItemHistory]
SET NOCOUNT ON;
DECLARE @Wkid int
DECLARE @Histid int
SELECT Wkid = @Wkid, Histid = @Histid FROM Deleted
Set Histid = @Histid
where wkid = @wkid