When creating an application and using a table with a primary key, you should check whether the table has a primary key or if there are no duplicate identifiers?
I came across some code that I support, checking that there are no duplicate identifiers in the result set. But the verified identifier is the primary key. Therefore, I do not need this check, since you cannot have primary keys with the same value.
But ... should this be checked if the DBA disconnected the primary key in the table for any reason or suggested that the primary key should always be there?
source
share