RE: SQL SERVER CONSTRAINT VIOLATIONS

RE: SQL SERVER CONSTRAINT VIOLATIONS

 

  

Run a query to find out what values exist more than 1 time in your table:

select column_name, count(column_name)
group by column_name
having count(column_name) > 1

Julia

-----Original Message-----
From: Chip Smith [mailto:[Email Address Removed] Wednesday, September 17, 2003 9: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