clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 756564 fiddles created (13525 in the last week).

Create table tbl( id INT not null primary key, title varchar(100), newUrl varchar(100) unique, ) -- CREATE UNIQUE INDEX newUrl on tbl(newUrl)
 hidden batch(es)


Insert INTO tbl(id, title, newUrl) values (1,'test1', '40504') Insert INTO tbl(id, title, newUrl) values (2,'test2', '40505') Insert INTO tbl(id, title, newUrl) values (3,'test3', '40504')
Msg 2627 Level 14 State 1 Line 3 Violation of UNIQUE KEY constraint 'UQ__tbl__8C52427FFE9079AF'. Cannot insert duplicate key in object 'dbo.tbl'. The duplicate key value is (40504). Msg 3621 Level 0 State 0 Line 3 The statement has been terminated.
 hidden batch(es)


Select * from tbl
id title newUrl
1 test1 40504
2 test2 40505
 hidden batch(es)