New to SQL Server and need help with check constraint.
How can I create a check constraint on DateOfBirth column to only allow date of birth which is age 18 or greater? Example of current syntax:
Create Table Member (
Memberid Int IDENTITY (1,1) PRIMARY KEY,
Title Varchar(10),
Firstname Varchar(40),
Lastname Varchar(40),
DateOfBirth Date Not Null
);
2条答案
按热度按时间j2qf4p5b1#
Try this one mate!
lf5gs5x22#
Try this one Mate, It'll allow those who are 18 or above only