Sai Reddy

Sai Reddy

  • NA
  • 214
  • 31.6k

On delete set null on update set null

May 10 2018 1:34 AM
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)