Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2004-05-26 : 11:23:47
|
| I need to add a Unique constraint to a field on a existing table.however there is all ready alot of dupes in that field.I tried several variations of count to no avail. Any Ideas???JimUsers <> Logic |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2004-05-26 : 11:39:30
|
| [code]select field1, count(*) from mytable group by field1 having count(*) > 1[/code]Possibly?? |
 |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2004-05-26 : 13:20:12
|
| Thanks Rick (boy do I feel stupid)JimUsers <> Logic |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2004-05-26 : 13:25:54
|
| Thanks TaraThere were only 35 dupes out of 265,000 records.It was faster to clean it by hand.JimUsers <> Logic |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-05-26 : 13:29:45
|
quote: Originally posted by JimL Thanks TaraThere were only 35 dupes out of 265,000 records.It was faster to clean it by hand.JimUsers <> Logic
Where you playing Ranger over the weekend? Brett8-) |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2004-05-27 : 05:22:52
|
quote: Originally posted by JimL Thanks Rick (boy do I feel stupid)JimUsers <> Logic
We all get our moments... |
 |
|
|
|
|
|