Friday, January 27, 2012

Prevent duplicate rows using unique index

create table test(id int identity(1,1), name varchar(10))create
insert
unique index ix_test on test(name) with IGNORE_DUP_KEY into test(name)values('ppv')select * from test

No comments:

Post a Comment