How would you prevent duplicate entries in a column in SQL.

How would you prevent duplicate entries in a column in SQL.

am 23.02.2005 02:49:02 von Imran Aziz

How would you prevent duplicate entries in a column in SQL ?
Imran

Re: How would you prevent duplicate entries in a column in SQL.

am 23.02.2005 07:44:10 von gerard.leclercq

Put a UNIQUE index (not duplicates allowed) on it.



"imran aziz" schreef in bericht
news:%23$%23ggnUGFHA.2676@TK2MSFTNGP12.phx.gbl...
> How would you prevent duplicate entries in a column in SQL ?
> Imran
>

Re: How would you prevent duplicate entries in a column in SQL.

am 23.02.2005 14:17:26 von raydan

Sounds like a good candidate for the primary key.

"imran aziz" wrote in message
news:%23$%23ggnUGFHA.2676@TK2MSFTNGP12.phx.gbl...
> How would you prevent duplicate entries in a column in SQL ?
> Imran
>
>

Re: How would you prevent duplicate entries in a column in SQL.

am 03.03.2005 02:19:24 von Bullschmidt

If showing results and you don't want duplicates:

strSQL = "SELECT DISTINCT LName FROM MyTable ORDER BY LName"

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!