IF NOT EXISTS(SELECT * FROM dbo.com_project_transaction_link
WHERE pt_tr_transaction_id = @transactionId
AND pt_pj_project_id = @projectId)
BEGIN
INSERT INTO dbo.com_project_transaction_link(pt_tr_transaction_id, pt_pj_project_id)
VALUES (@transactionId, @projectId)
END
I want to fix this proc. Right now, if it DOESN’T find a record that has the passed in projectId AND transactionId, it will insert it. I want to make this so if it finds the transactionId at ALL, it will perform an update with the new projectId, however if it doesn’t find it, it will do what it does now.
Can I grab some help 🙂
Thanks!
This should get you started: