RE: SQL SERVER CONSTRAINT VIOLATIONS

RE: SQL SERVER CONSTRAINT VIOLATIONS

 

  

There may be a better way, but you could run a query on the field (s) that
make up the constraint and count the occurrences greater than 1. This would
return the records that are duplicated, which you could then use to correct
the problem.

-----Original Message-----
From: Chip Smith [mailto:[Email Address Removed] Wednesday, September 17, 2003 11:03 AM
To: LazyDBA.com Discussion
Subject: SQL SERVER CONSTRAINT VIOLATIONS


Hi all,

Trying to add a unique constraint to a table with many, many millions of
rows. Dies with an obvious duplicate
but no clue which record. Oracle has an exceptions into clause. Is there
anything similar in sql server 2000?

TIA

-- chip

MS Sql Server LazyDBA home page