if (@@ERROR != 0) begin
end else begin
Whenever I try to run the above code, where the first proc inserts a new note, and returns the ID, I get the following message when the second proc is run:
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_cor_PartnerNoteVisibility_cor_PartnerNotes'. The conflict occurred in database 'junk', table 'cor_PartnerNotes', column 'NoteID'.
The statement has been terminated.
Is what I'm trying to do possible? Because basically I don't want any of the data inserted if the second proc fails.