I've inherited a project that somehow ended up with random rows in the application settings table getting duplicated. I got the duplicate rows removed successfully, but then I noticed that the actual values, of type nvarchar, for said rows are also duplicated.
For instance, one row has Key column Error Email Address
and Value column websupport@mycompany.com,websupport@mycompany.com
. The Value column should just contain websupport@mycompany.com
. There are numerous records like this, all following the same pattern of The value,The value
.
How can I detect when the Value column contains this kind of duplicated data and correct it?
Note that the comma alone is not enough to say the row is invalid, because things like Key Default Error Message
Value Oops, something went wrong
are correct and also contain a comma.