:::: MENU ::::

Is it possible to have NULL value in foreign key?

  • May 07 / 2010
  • 0
Data Modeling and Database Design, dbDigger, T-SQL Interview Questions

Is it possible to have NULL value in foreign key?

It is interesting question that either a foreign key column can have NULL value or not? The answer is Yes. A foreign key column may have NULL value. It simple means that you can record with NULL value in foreign key column is not associated with any record of primary key (being referenced) table.
It may easily be bound to have no NULL value in foreign key column. Simply alter it with NOT NULL constraint and it would prevent NULL value like any other column.

Consult us to explore the Databases. Contact us