79220091

Date: 2024-11-24 12:55:15
Score: 0.5
Natty:
Report link

You can create/modify index using IGNORE_DUP_KEY.

DROP INDEX ix_test_column ON test; -- if exists
CREATE UNIQUE INDEX ix_test_column 
ON test(unique_column)
WITH (IGNORE_DUP_KEY = ON);

INSERT INTO test (unique_column, other_column)
VALUES 
    ('one', 'mary'),
    ('two', 'john'),
    ('one', 'jack');

fiddle

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: keithwalsh