Error In SQL SERVER DataBase

Tags:
Database programming
Microsoft Visual Studio
NULL values
Primary keys
SQL Server errors
VARCHAR
Visual Studio 2008
am trying to insert four varchar(50) values in a table which is with a primarykey column id_number. i didnt check : "True" to the null field . so it should not allow null values in table. but while am trying . it allows null values. including primary key column. how is possible ? pls help me. i am using this database with visual studio 2008

Answer Wiki

Thanks. We'll let you know when a new response is added.

If you Primary Key column allows null, then it’s not setup as a primary key as primary key columns can not allow null values in them.

If you check the box in the UI it tells to column to allow nulls.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Denny Cherry
    Check out my SQL Server blog "SQL Server with Mr Denny" for more SQL Server information.
    67,655 pointsBadges:
    report
  • Jaideep Khanduja
    if you check the properties of column_id, it would not have been set as a primary key, else it would not allow null values.
    12,670 pointsBadges:
    report
  • Brijesh
    Primary Key is unique key identifier and can not be null. It never allows null values.
    14,435 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: