Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disallowing duplicate entries in a table

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

This is a quickie... what SQL command must I execute to disallow duplicate entries in a table? I am assuming that the primary key field doesn't count when the system figures out if a row is a duplicate. Thanks in advance.

Xin Li
 

Create a primary key or a unique index on the table. This can be done with Enterprise Manager or with T-SQL. Read the following topics in SQL Books Online (BOL).

[ul][li]Primary Key Constraints
[li]Creating and Modifying PRIMARY KEY Constraints
(This topic show how to do create and modify!)
[li]Creating and Modifying UNIQUE Constraints
(Also has "How to" info.)
[li]Using Unique Indexes[/ul] Terry
------------------------------------
Blessed is the man who, having nothing to say, abstains from giving us worthy evidence of the fact. -George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top