Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Check Constraints
CREATE TABLE Persons ( ID int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Age int, City varchar(255), CONSTRAINT CHK_Person CHECK (Age>=18 AND City='Sandnes') ); insert into Persons(id,LastName,FirstName,Age,City)values(1,'vinod','kumar',34,'sandnes'); /* Error(s), warning(s): The INSERT statement conflicted with the CHECK constraint "CHK_Person". The conflict occurred in database "rextester", table "dbo.Persons". The statement has been terminated. The check constraint for age is applied i.e age when enterd with less than 18 ,it given the above error */ select * from Persons;
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
QLSV
Microsoft SQL Server T-SQL in 10 mn ~ Lesson 13 Subqueries vers. #5
Trabalho.Agrecação
Q2_30min
First Query
Lab assessment 2
Week 6 Data Base IET
test
NOT NULL field from SELECT INTO
class
Please log in to post a comment.