|
-
Dec 2nd, 2002, 08:40 PM
#1
Thread Starter
Hyperactive Member
Unique Key Constraint
I need to put a unique key constarint on two fields on a table which I have made in the Sql Server. Please help me in the syntax.
-
Dec 2nd, 2002, 09:04 PM
#2
Thread Starter
Hyperactive Member
can II put the unique key constraint on a bit field. I need to put the constraints on two fields one of which is a bit field. That field is for marking the record as deleted or existing.
-
Dec 3rd, 2002, 08:07 AM
#3
Frenzied Member
I don't think it matters what the data type is - just that the field does not allow NULLs.
Code:
CONSTRAINT myConstraint UNIQUE NONCLUSTERED (field1, field2)
Here's what MSDN has to say on the subject:
http://msdn.microsoft.com/library/de...eate2_8g9x.asp
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
|