Click here to Skip to main content
15,299,443 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to insert a null values into integer type column through stored procedure any body help me friends?

Ex: ID INT NOT NULL,
NAME NVARCHAR (100) NOT NULL


USE C# AND ASP.NET TO SOLVE A PROBLEM ANY BODY HELP ME.....

THANKS ,
ANIL
Posted
Comments
Rockstar_ 24-Apr-13 0:56am
   
Make the ID column type to Allow Nulls...

1 solution

You can't.
If you explicitly say:
SQL
ID INT NOT NULL
Then you cannot set it's value to null using a stored procedure or by any other means, and you have told SQL that the column can only contain intger values, and not nulls.
The only way to do it is to change the definition of the column to allow nulls:
SQL
ID INT NULL
However, given that this is an ID column, it is probably best to leave them as NOT NULL so that you don't get duplicates...
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900