Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

SQL Create Named CHECK Constraint

-- creates a named constraint named amount CK
-- the constraint makes sure that amount is greater than 0
CREATE TABLE Orders (
  order_id INT PRIMARY KEY,
  amount INT,
  CONSTRAINT amountCK CHECK (amount > 0)
);
 
PREVIOUS NEXT
Tagged: #SQL #Create #Named #CHECK #Constraint
ADD COMMENT
Topic
Name
6+3 =