Pauldohert
03-16-2006, 05:08 AM
I am using
ALTER TABLE [dbo].[Table] ADD
CONSTRAINT [Field1_Field2] UNIQUE NONCLUSTERED
(
[Field1],
[Field2]
) ON [PRIMARY]
To create a constraint so that Field1 and Field2 together are unique.
This works fine. However as these are existing tables if there is data which contradicts these rules the ALTER TABLE fails.
Is there a way to force thu the update - so it deletes the non unique data?
Thanks
ALTER TABLE [dbo].[Table] ADD
CONSTRAINT [Field1_Field2] UNIQUE NONCLUSTERED
(
[Field1],
[Field2]
) ON [PRIMARY]
To create a constraint so that Field1 and Field2 together are unique.
This works fine. However as these are existing tables if there is data which contradicts these rules the ALTER TABLE fails.
Is there a way to force thu the update - so it deletes the non unique data?
Thanks