Replace null value

Replace null value

Post by ron » Sat, 02 Nov 2002 00:36:29



Hi,
I have a table that contains over 800,000 records and i
recently added three new fields to the table with type
smallint.
I set there fields to allow null values.
I would like to go through each record and replace the
null value with the value of "0".
What is the best way to go about this and where may i find
an example.
Thanks, Ron
 
 
 

Replace null value

Post by Aaron Bertrand [MVP » Sat, 02 Nov 2002 00:43:02


UPDATE table SET columname = 0 WHERE columnname IS NULL


Quote:> Hi,
> I have a table that contains over 800,000 records and i
> recently added three new fields to the table with type
> smallint.
> I set there fields to allow null values.
> I would like to go through each record and replace the
> null value with the value of "0".
> What is the best way to go about this and where may i find
> an example.
> Thanks, Ron


 
 
 

Replace null value

Post by ron » Sat, 02 Nov 2002 00:49:40


Aaron,
That worked very well thanks for the help.
Ron

>-----Original Message-----
>UPDATE table SET columname = 0 WHERE columnname IS NULL



>> Hi,
>> I have a table that contains over 800,000 records and i
>> recently added three new fields to the table with type
>> smallint.
>> I set there fields to allow null values.
>> I would like to go through each record and replace the
>> null value with the value of "0".
>> What is the best way to go about this and where may i
find
>> an example.
>> Thanks, Ron

>.