sql - Why (By Default) Foreign Key is Null ? . . and Can Foreign Key and Primary Key be the same Column? -


i have followed following steps:

  1. created 2 tables (no constraint)
  2. alter table#1 (add not null , primary key constraint)
  3. alter table#2 (add foreign key constraint) . . , trying add primary key constraint column foreign key table#2

got error column can not null.

it practice foreign key reference primary key. getting error because primary key can't set on nullable column. can change primary key identity column ?


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -