|
-
Jan 8th, 2000, 12:10 PM
#1
Thread Starter
New Member
How do I check for duplicate records in
a field that does not allow duplicates.
jim
-
Jan 9th, 2000, 01:00 AM
#2
Guru
If the field already does not allow duplicates, it will perform the validation for you. All you have to do is handle the error that will be generated
-
Jan 11th, 2000, 05:58 AM
#3
Frenzied Member
Tom, there are instances in SQL server when you can have a field that does not allow duplicates that has them. BCP, for example, can do this on SQL Server.
smartbid,
select key, count(key) from table group by key
will give you a list of all your keys (replace the word 'key' with your fieldname) and the number of times they occur. If you get a count greater than 1, you have duplicates.
-
Jan 11th, 2000, 01:10 PM
#4
Guru
Would that be the exception, not the rule?
Is it not wise to allow the DBMS to perform the validation with normal transactions?
-
Jan 11th, 2000, 11:03 PM
#5
Frenzied Member
Definitely.
Sometimes you don't get a choice, BCP is a good example.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|