2
Answers

On delete set null on update set null

Sai Reddy

Sai Reddy

6y
1.1k
1
Hi, 
 
I have two tables called 
 University(Had Primary Key)
 Student
 
Here i am trying create fk on Student table with the condition ON UPDATE SET NULL ON DELETE SET NULL 
 
The following is an error.
 
Msg 1761, Level 16, State 0, Line 1
Cannot create the foreign key "fk_on_Student" with the SET NULL referential action, because one or more referencing columns are not nullable.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
 
 
 
Answers (2)