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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manish TewatiaRank #48 · 31.3K reputationPosted Jul 5, 2011, 10:47 PM EDT
Check this link, having all details about the NULL value: http://www.postgresql.org/files/documentation/books/aw_pgsql/node36.html
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jul 5, 2011, 10:51 PM EDT
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.......
anjumathi kumar54 reputationPosted Jul 5, 2011, 11:03 PM EDT
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 SampathiraoRank #585 · 4.1K reputationPosted Jul 5, 2011, 11:17 PM EDT
write query like this:
update table_name set column_name='your_value' where column_name='null'
Blocked AccountRank #403 · 6.2K reputationPosted Jul 5, 2011, 11:27 PM EDT
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.
Suthish NairRank #92 · 22.8K reputationPosted Jul 5, 2011, 11:58 PM EDT
update table_name set column_name = isnull(column_name, '')
It will update all null columns with default value or ''.