How To Speed Up Adding Column To Large Table In Sql Server
- by Chris
I want to add a column to a Sql Server table with about 10M rows. I think this query would eventually finish adding the column I want:
alter table T
add mycol bit not null default 0
but it's been going for several hours already. Is there any shortcut to get a "not null default 0" column inserted into a large table? Or is this inherently really slow?
This is Sql Server 2000. Later on I have to do something similar on Sql Server 2008.