I ended up using a separate table and a foreign key for this, but never the less, here's how to use the Check constraint, in my case, to limit RecordStatus to contain only 'Active' or 'Inactive':
CREATE TABLE NewsItems (
NewsItemID int IDENTITY NOT NULL PRIMARY KEY,
RecordStatus nvarchar(10) NOT NULL DEFAULT 'ACTIVE' CHECK (RecordStatus IN ('Active', 'Inactive'))
);
No comments:
Post a Comment