Is there a way I can check if a value exists in a table I want to insert into activated by a trigger? If the value does exist, I want nothing to be done and if it doesn't I would like it to be inserted.
This is my current trigger
ALTER TRIGGER [dbo].[Update]
On [dbo].[A]
AFTER UPDATE
AS
Declare @Id int;
SELECT @Id = Issue FROM Inserted
INSERT INTO dbo.[B] (id, problem)
SELECT BugId, ProjectID
FROM dbo.[C]
WHERE BugId = @Id and (projectid = 547)
Many thanks