I am creating a simple table and adding a key constraint to make sure I have no duplicates when I update the table.
CREATE TABLE [TableName](
[FirstName] [varchar](50) NOT NULL,
[LastName] [varchar](50) NOT NULL,
[Phone] [varchar](50) NOT NULL
);
ALTER TABLE [TableName]
ADD CONSTRAINT unique_row UNIQUE (
[FirstName],[LastName]
);
Assume I have a row Jack Smith 999-999-999
and I am loading Jack Smith 888-888-888
, the second choice won't be loaded due to key constraint.
Is there a way to specify a table to store new value and delete the old value.