chandresh43
asked on
insert null in sql server
cattable
id int
parentid int
title text
i want to insert null value
in parentid coloum
in asp,net
id int
parentid int
title text
i want to insert null value
in parentid coloum
in asp,net
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
why don't you use nullable datatype from Asp.Net??? look at that
http://www.codeguru.com/csharp/.net/net_asp/tutorials/article.php/c10393
if you have nullable datatype and nothing is assigned in it, it will insert NULL in database.
http://www.codeguru.com/csharp/.net/net_asp/tutorials/article.php/c10393
if you have nullable datatype and nothing is assigned in it, it will insert NULL in database.
INSERT CATTABLE(id, title) VALUES(1, 'Top of the tree');
or
INSERT CATTABLE(id, parentid, title) VALUES(1, DEFAULT, 'Top of the tree');
http://msdn.microsoft.com/en-us/library/ms174335.aspx contains all the reference you should need for the INSERT statement.