sql - Disallow duplicate columns for more than one other column value? -
sql - Disallow duplicate columns for more than one other column value? -
the reply i've come close accepting 1 involving setting of unique constraint on column.
what need is:...in sql, disallow duplicate entries between 2 columns. so, have 2 columns, 'parcel' , 'year'. how go disallowing duplicate entry of parcel = 1, year = 1, , parcel = 1, year = 1? need while still allowing duplicates in each respective column, disallowing
add unique constraint spans 2 columns:
alter table table_name add together constraint constraint_name unique (parcel, year);
sql sql-server sql-server-2008
Comments
Post a Comment