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

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -