Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You are confusing sweet with soft.
Constraint constraint - when you set table parameters with create/alter table
you are saying that a constraint is being set for such and such a field.
Constraints can be primary key, foreign key, unique, default, check, etc. - these are all constraints.
Here is the table:
CREATE TABLE MYTABLE (
ID BIGINT NOT NULL CONSTRAINT PK_MYTABLE PRIMARY KEY,
CLIENT BIGINT NOT NULL CONSTRAINT FK_MYTABLE_CLIENT FOREIGN KEY REFERENCES CLIENTS(ID),
EMAIL NVARCHAR(100) NOT NULL CONSTRAINT UQ_MYTABLE_EMAIL UNIQUE,
ACTIVE BIT NOT NULL CONSTRAINT DF_MYTABLE_ACTIVE DEFAULT (1)
)
foreign keyLink to another table.
constraintLimitation. May not be related to another table. For example, a date is limited to a certain period.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question