0

Question

The title says it all, I would like something like this:

update [table]
set [all columns] = null
where [all columns] = ''
;

I have a very large table and while taking a break before diving in and doing some alterations column by column ( >100 total columns and >500k rows), I figured I would look for a broader solution.

BackStory

I'm dealing with an import (no hardcopy), no ability to access hardcopy. I do have access to the raw imported file thoguh. Anyway all columns are in US currency. For whatever reason instead of filling $0 for those entries they decided on blank '', not null but blank ''. Anything would be better than blank lol.

Thank You

Shadow
  • 33,525
  • 10
  • 51
  • 64
user2101459
  • 579
  • 2
  • 8
  • 19
  • 1
    Whats the issue you are having with this update? – Teja Oct 19 '16 at 05:29
  • There is no broader solution in sql, you need to list all fields in the select and where criteria. You may use script or even sql script to generate the final sql statement. – Shadow Oct 19 '16 at 05:45
  • trying to close or take down queston. got the idea from comments and the previous thread i duplicated. thank you, I'll do more thorough research next time – user2101459 Oct 19 '16 at 06:54
  • you said "they decided on blank '', not null but blank '' - not sure who are "they" - but we know that there was a moron which created a table with a non numeric currency field.... – Georg Richter Oct 23 '16 at 19:45

0 Answers0