Loading ...
Sorry, an error occurred while loading the content.

[SQL Server]Add NOT NULL Constraint in SQL Server

Expand Messages
  • vijaya_krishna_birju
    Today I will explain about the different ways to add a NOT NULL constraint on a column. Advantages of NOT NULL constraint: 1) You can prevent users to enter
    Message 1 of 1 , Apr 12, 2009
    • 0 Attachment
      Today I will explain about the different ways to add a NOT NULL constraint on a column.

      Advantages of NOT NULL constraint:
      1) You can prevent users to enter null values into this column.
      2) The pre-requisite to enforce Primary Key on a Column.

      Now Lets get into the details:
      There are two ways which i can think of
      1) While creating the table using CREATE TABLE statement.
      2) Modifiying the table definition using ALTER TABLE statement.

      Check out the below link for complete information with examples:
      http://www.dotnetvj.com/2009/03/add-not-null-constraint-in-sql-server.html
    Your message has been successfully submitted and would be delivered to recipients shortly.