For the benifits of the users I am sending this post,
This type of error can occur in any server product. The client sends a reqest and waits for the response. If the response if not received within the time specified you will receive a timeout error. For your case it happens because of the size of the table.
As a simple solution you can increase the query timeout value. If you specify the value to 0 it will wait indefinitly (until the server responds back)
if you are using a non dev system where performance is an issue re-write your code slightly differently. Dont add the new column with NOT NULL clause. create it will NULL. then update witht he default value for small chuck of data. Finally you can add the default value if you want.
This is a sample code.
ALTER TABLE <table1> ADD <NewColumn> varchar (50) NULL
DECLARE @Min int, @Max int, @Current int
SELECT @Min = MIN(TableID), @Max= MAX(@TableID) from <table1>
SET @Current = @Min
WHILE @Current <= @Max
BEGIN
UPDATE <Table1> SET <newColumn> = 'DEfault Value' WHERE TableID >=@Current AND TAbleID <@Current+1000
SET @Current = @Current+1000
END
G.R.Preethiviraj Kulasingham MCITP: DBA
http://preethiviraj.blogspot.com/
Plan Your Work and Work Your Plan!