I'm trying to automatically update a table when new rows have been inserted but my trigger is just putting null results into the table.
Basically I want to make CampaignID = CampaignID in the Signals table
ALTER TRIGGER UpdateSignalCounts
ON Signals
AFTER INSERT
AS
DECLARE @CampaignID INT
SET @CampaignID FOR SELECT CampaignID FROM Signals
BEGIN
INSERT INTO SignalCounts (NumberRecieved, NumberOpened, NumberClicked, NumberForwarded, NumberUnsubscribed, NumberBounced, CampaignID)
(SELECT
COUNT(Recieved), COUNT(Opened), COUNT(Clicked), COUNT(Forwards),
COUNT(Unsubscribed), COUNT(Bounced), @CampaignID
FROM
Signals
WHERE
CampaignID = @CampaignID);
END