Hi
I'm trying to add a unique constraint to a table on 2 seperate columns, however even with the "with nocheck" specified, the system says I can't add it because of duplicate key
the sql I have now is:
Loc_Tpe is a varchar and Loc_IntID is an int, and both would have duplicates in it individually, but should be unique together (however there's some non-unique ones at the moment)
I'm sure the syntax is correct, so why is the nocheck not working?
Thanks guys/gals...
--------------------
Procrastinate Now!
I'm trying to add a unique constraint to a table on 2 seperate columns, however even with the "with nocheck" specified, the system says I can't add it because of duplicate key
the sql I have now is:
Code:
alter table T_Location with nocheck
add constraint [CK_T_Location_UniqueObj] UNIQUE (Loc_Tpe, Loc_IntID)
GO
Loc_Tpe is a varchar and Loc_IntID is an int, and both would have duplicates in it individually, but should be unique together (however there's some non-unique ones at the moment)
I'm sure the syntax is correct, so why is the nocheck not working?
Thanks guys/gals...
--------------------
Procrastinate Now!