Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
MrZen
Starting Member
2 Posts |
Posted - 2005-02-24 : 17:54:31
|
Got a problem with a SQL server table. I need to go through all rows in the table and replace null values with 0. Any help with this appreciated. I want to keep all column names the same. Its only the null values that I would like to change.HISTORY BEHIND THIS MESS...: I export the table into an excel spreadsheet. The macro on the spreadsheet can not handle null values and falls over.Thanks |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2005-02-24 : 18:04:00
|
| [code]--For numericUPDATE myTable Set myfield = 0 where myfield IS NULL--For stringUPDATE myTable Set myfield = '0' where myfield IS NULL[/code]Michael<Yoda>Use the Search page you must. Find the answer you will.</Yoda> |
 |
|
|
Xerxes
Aged Yak Warrior
666 Posts |
|
|
Xerxes
Aged Yak Warrior
666 Posts |
|
|
MrZen
Starting Member
2 Posts |
Posted - 2005-02-25 : 03:48:40
|
| Can I get the above set command for a numeric example, to include multiple columns into one statement to keep the code tidy or is it a whole statement per column?Thanks |
 |
|
|
|
|
|