New answers tagged unique-key
It is not possible to have 'hidden' columns. When you are using GUIDs to avoid merge conflicts, you must use GUID keys in every table that contains data to be merged. And when you already have a GUID, it does not make sense to add another column to the primary key. If you do not want to use GUIDs, just deal with the conflicts, i.e., instead of blindly ...
In addition to the differences posted in other answers (including some that I think were unfairly downvoted) there are some key differences between the two. Note: The error messages are from SQL Server 2012. Errors Violation of a unique constraint returns error 2627. Msg 2627, Level 14, State 1, Line 1 Violation of UNIQUE KEY constraint 'P1U_pk'. Cannot ...
In Oracle a major difference is you can create a function-unique index, which is not doable with unique constraints: For example create unique index ux_test on my_table (case when amount != 0 then fk_xyz end); So fk_xyz is only unique for record which have amount != 0.
Top 50 recent answers are included