[dba-SQLServer] [AccessD] Apples to Oranges

jwcolby jwcolby at colbyconsulting.com
Tue Oct 5 06:12:54 CDT 2010


Stuart,

Would this really work?  Given that it is simultaneously updating 540+ fields for 50 million rows, 
would it ever finish?

I could have my assistant dynamically create this sql statement if you think this is a viable 
alternative.

John W. Colby
www.ColbyConsulting.com

On 10/4/2010 6:39 PM, Stuart McLachlan wrote:
> At 1/2 hour / field, it should only take about 11.25 days :-)
>
> But my question is, do you have to do it a single field at a time? can't you
> update all the fields in a single pass? Something like:
>
> Update mytable set
> field1 = case field1
>                      when " "  then Null
>                      else field1
>               end,
> field2 = case field2
>                      when " "  then Null
>                      else field2
>               end,
> field3 = case field3
>                      when " "  then Null
>                      else field3
>               end,
> ...
>



More information about the dba-SQLServer mailing list