How can i insert blank value or null value in database..
its suitable to all datatypes like int, char ,and ,date, decimal ..
if i give null mean it not accept by integer
i give textbox.text="" it also not accepted wat the solution
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Jul 6, 2011, 3:58 AM
update table_name set column_name = isnull(column_name, '')
It will update all null columns with default value or ''.
Blocked AccountPosted Jul 6, 2011, 3:27 AM
name varchar NotNull
id int Null
dob datetime notnull
according to your scenario
In name field you can insert blank value easily
In Id filed you can insert Null easily but if you will insert blank value, Sql server automatically replace it with default integer value that is 0
In DOB , if you will try to insert blank value, it will convert into it default datetime value that is '1900-01-01 00:00:00.000'.
so i mean to say, if you have allowed Nulls in your column, then you can insert either null value or default value. if you will send blank value to datetime or int type of column, Sql Server automatically converts into the defaults value.
Jiteendra SampathiraoPosted Jul 6, 2011, 3:17 AM
write query like this:
update table_name set column_name='your_value' where column_name='null'
anjumathi kumarPosted Jul 6, 2011, 3:03 AM
colname data type Null
name varchar NotNull
id int Null
dob datetime notm null
my table mixed up with null and not null..but i want to insert null or blank value to all records in the fields..this is my query..
now say solution for this problem
Jiteendra SampathiraoPosted Jul 6, 2011, 2:51 AM
when design the database table check allow null option...
see the below figure..
if you pass a empty value..it accepts as null...
I hope it help you.......
Manish TewatiaPosted Jul 6, 2011, 2:47 AM
Check this link, having all details about the NULL value: http://www.postgresql.org/files/documentation/books/aw_pgsql/node36.html