Question

  Asked: Jul 24 2008   9:41 AM GMT
  Asked by: SrimanBenivolent


Error In SQL SERVER DataBase


VARCHAR, NULL values, Primary keys, Database programming, Visual Studio 2008, Visual Studio, SQL Server errors

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

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development, Database and SQL Server.

Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Mrdenny  |   Jul 24 2008  7:15PM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 

Jaideepkhanduja  |   Jul 28 2008  8:00AM GMT

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.