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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help check constraint no duplicate record

Status
Not open for further replies.

AnnYH

IS-IT--Management
Jul 22, 2002
22
0
0
CA
Hi, Everyone:

Is it any way can help me to solve my question?

In my main table, I have primary key PID. And another column is WBNUM( data type: nvarchar , allowed Null).

For WBNUM, I need this column can be null, after it is entered a data, they are not allowed to be duplicate.

What can I do for this? I try creating a Unique Constraint, but you must ensure that at most one row will have a null.

I must allowed more than one row to be null.

Any idea, please help. Thanks a lot

Ann
 
Do it with a trigger instead of a constraint. Use an if statement in the trigger to check if it is null and then do the check only if it is not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top