Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Check Constraints
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
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;
View schema
Execution time: 0,02 sec, rows selected: 1, rows affected: 1, absolute service time: 0,17 sec
edit mode
|
history
|
discussion
ID
LastName
FirstName
Age
City
1
1
vinod
kumar
34
sandnes