You can create a unique constraint on the the tabl...
# help
b
You can create a unique constraint on the the table so that the combination of those two values is always unique.
f
Thanks, didn't know that was a thing
do you have any links you can share on how to implement this?
just saw that it is a sql statement something like CONSTRAINT UC_Person UNIQUE (ID,LastName) can you add this to an existing table?
p
I can see 2 approaches for this, either implement a generated column or use a function that is triggered on insert and updates
f
Copy code
ALTER TABLE Persons
ADD CONSTRAINT UC_Person UNIQUE (ID,LastName);
think this is it
b
@User Yeah, that looks right
f
thanks!!!!