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.
Printable View
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.
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.
I don't think it matters what the data type is - just that the field does not allow NULLs.
Here's what MSDN has to say on the subject:Code:CONSTRAINT myConstraint UNIQUE NONCLUSTERED (field1, field2)
http://msdn.microsoft.com/library/de...eate2_8g9x.asp