Execution time of ALTER COLUMN

Posted by Tommy Jakobsen on Stack Overflow See other posts from Stack Overflow or by Tommy Jakobsen
Published on 2010-03-17T20:04:34Z Indexed on 2010/03/17 20:11 UTC
Read the original article Hit count: 423

Filed under:
|
|

Having a table with 60 columns, and 200 rows. Altering a BIT column from NULL to NOT NULL, now has a running execution time of over 3 hours. Why is this taking so long?

This is the query that I'm execution:

ALTER TABLE tbl
ALTER COLUMN col BIT NOT NULL

Is there a faster way to do it, besides creating a new column, updating it with values from the old column, then dropping the old column and renaming the new one?

This is on MS SQL Server 2005.

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005