I am in middle of a debate about whether it is better to make a PRIMARY KEY
out of an Identity Columns, our out of a UDF that explicitly generates a unique id.
- I am arguing for the Identity Column.
- My partner is arguing for generating the values manually, he claims
- by putting the UDF on another table where we can have a UDF
- lock the resource
- increment an ID table with one field called
ID_Value
by1
- use this as a global unique identifier
- Or have the table do an
id+1
when inserting - That it's simpler to move data between servers and/or environments not having the identify constraint; moving from one DB where there is data to another similar DB with lets say staging or dummy data. For testing in non production we may want to pull all records from yesterday down to staging for testing.
- by putting the UDF on another table where we can have a UDF
Which implementation makes more sense?