{{theTime}}

Search This Blog

Total Pageviews

java.sql.SQLException: Violation of PRIMARY KEY constraint 'DEPARTMENT_PK'. Cannot insert duplicate key in object 'dbo.DEPARTMENT_TABLE'. The duplicate key value is (100193).

This exception will be thrown when same Department record is inserting into the table DEPARTMENT_TABLE.

Quick Fix1: (Pseudo code)
                 Try {
                             Update department_table
                 }catch(java.sql.SQLException) {
                        Insert into department_table
                 }

No comments:

Java Script GET request Sample Code

fetch(' https://api.public.com/api ')   .then(response => response.json())   .then(data => console.log(data))   .catch(error =...