var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Catching violation of UNIQUE KEY constraint in stored procedure
I have a stored procedure which bulk inserts records into a table based on a passed in variable that contains comma separated values of record Ids.
However I have a constraint on the table ensuring that value-pairs in 2 columns must be unique (as a person can not be twice on the same project)
Since I insert the passed in person Ids in a loop, I’d like to catch if this constraint has been violated and skip that specific cycle if it has but do commit the rest.
Not sure if this can be done, and if yes could someone let me know the SQL syntax and structure please?
Am I explaining this clearly?
Thanks in advance all comments are much appreciated!
Can you test on @@ERROR ?
Cool, seems to do it, forgot about it, I actually had it in there. No I just collect the Ids and return them as output csv to let user know!
Thanks for the idea!