Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Enter Null Values for text Column of SQL Server
Posted
Comments
CHill60 29-May-14 5:38am    
And your question is?
Soft009 29-May-14 5:40am    
where is the question?

Try:
SQL
INSERT INTO MyTable (MyColumn) VALUES (NULL)
 
Share this answer
 
If the string column is nullable

Insert INTO table_name (id, name) value (1,NULL)
 
Share this answer
 
Comments
CHill60 29-May-14 5:51am    
Worth mentioning that if id is set up as an autoincrement identity column then you should not try to insert it
For completeness, if you want to update an existing row then you would use this construct
UPDATE MyTable SET MyColumn=null WHERE ID = 2 -- or whatever
 
Share this answer
 
Check in database is this column allow null or not if yes then try
Solution 1
else allow null value to this column
 
Share this answer
 

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