pavan_kumard
Jul 6th, 2000, 01:36 AM
hi,
i am facing an unusual problem when I am trying to insert a "null" value into SQL Server database.suppose I have a table named X and in that tables i have three columns a,b,c.suppose i say a is varchar datatype,b is numeric and it allows nulls,c is numeric
now as b allows nulls,i want to insert a null "null" into column b.One way of coming around this problem is in the front end using a querydef i use the insert statement as follows.insert into x(a,c)values(& a &,& c &).ie i ommit the column that i want to enter a null.but i feel this to be a crude solution.i want to use an insert statement in which i use all values and if i am not including any thing in the front end ie not sending any value then a "null" should be entered into the database.
My second problem is i manually inserted a null<null>(ie i left a particular numeric column empty while entering a record into a particular table with the help of Sql Server enterprise manager.now when i am trying to retrieve this record i am getting an error.
i can come around this problem by mentioning on error resume next on the top.Can any one give me a better solution than this.
i am facing an unusual problem when I am trying to insert a "null" value into SQL Server database.suppose I have a table named X and in that tables i have three columns a,b,c.suppose i say a is varchar datatype,b is numeric and it allows nulls,c is numeric
now as b allows nulls,i want to insert a null "null" into column b.One way of coming around this problem is in the front end using a querydef i use the insert statement as follows.insert into x(a,c)values(& a &,& c &).ie i ommit the column that i want to enter a null.but i feel this to be a crude solution.i want to use an insert statement in which i use all values and if i am not including any thing in the front end ie not sending any value then a "null" should be entered into the database.
My second problem is i manually inserted a null<null>(ie i left a particular numeric column empty while entering a record into a particular table with the help of Sql Server enterprise manager.now when i am trying to retrieve this record i am getting an error.
i can come around this problem by mentioning on error resume next on the top.Can any one give me a better solution than this.