How To Speed Up Adding Column To Large Table In Sql Server

Posted by Chris on Server Fault See other posts from Server Fault or by Chris
Published on 2009-07-06T23:17:48Z Indexed on 2012/12/15 5:09 UTC
Read the original article Hit count: 371

Filed under:

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.

© Server Fault or respective owner

Related posts about sql-server