Error In SQL SERVER DataBase

Tags:
Database programming
NULL values
Primary keys
SQL Server errors
VARCHAR
Visual Studio
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: 2  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Denny Cherry
    Check out my SQL Server blog "SQL Server with Mr Denny" for more SQL Server information.
    66,005 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.
    8,975 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following