几千张表更新某个字段,这个字段又有几千种可能的值,怎么做快一些?
update table1 set col1=(case col1 when 100 then A when 90 then B ......)
update table2 set col1=(case col1 when 100 then A when 90 then B ......)
update table3 set col1=(case col1 when 100 then A when 90 then B ......)
一共几千张表,而col1这个字段有几千种可能,每种可能的值要换成相应的另一个值。
把这些语句放在一个sql文件里,都有上百M,放在sql server studio里打不开,直接卡死了。
请问这种情况下怎么做要好一点?