in my sql, i've been able to add empty string (varchar) fields by simply putting '' as their value. Now im wondering how I can do the same for integer fields? Would anyone know how to do this?
Thanks
How to enter an empty integer field in SQL querywhat would be the equivilent of a '' for an integer?
Page 1 of 1
2 Replies - 3020 Views - Last Post: 24 July 2009 - 11:29 AM
Replies To: How to enter an empty integer field in SQL query
#2
Re: How to enter an empty integer field in SQL query
Posted 24 July 2009 - 09:33 AM
Paat, on 24 Jul, 2009 - 08:29 AM, said:
in my sql, i've been able to add empty string (varchar) fields by simply putting '' as their value. Now im wondering how I can do the same for integer fields? Would anyone know how to do this?
Thanks
Thanks
I usually use 0 for the default value when NULL isn't an option.
#3
Re: How to enter an empty integer field in SQL query
Posted 24 July 2009 - 11:29 AM
Well im not sure about MySQL anymore but with MS-SQL, you can use DBNull as a null value.
I personally never use DBNull for a field. I always fill them in. For Numeric values i use -1 as a Null, String = "NOTHING", and DateTime = #1/1/1900#.
But thats just me. I also never use the numeric 0 as a data point.
I personally never use DBNull for a field. I always fill them in. For Numeric values i use -1 as a Null, String = "NOTHING", and DateTime = #1/1/1900#.
But thats just me. I also never use the numeric 0 as a data point.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|