Timeout expired when altering table

  • Hi all

    I need to change a table datatype from int to bigint which has 1million records... i dropped all the indexes except clustered index.. but it is timing out when i tried to modify the table... can anyone please help me to modify the table...

    Thanks in Advance!

    - Kerobin

  • Are you doing it through the GUI ?? I think I remember that in SQL 2000 I would get timeouts using the GUI because it had a timeout setting that got reached, whereas scripting out the command, then running it in a query window it ran fine. Not sure if 2005 has the same issue. Or perhaps there's a lock on the table ?

  • homebrew01 (10/22/2007)


    Are you doing it through the GUI ?? I think I remember that in SQL 2000 I would get timeouts using the GUI because it had a timeout setting that got reached, whereas scripting out the command, then running it in a query window it ran fine. Not sure if 2005 has the same issue. Or perhaps there's a lock on the table ?

    Ironically, I just ran into this this morning on '05. I guess this is MS's way of telling us that we should be scripting it out anyway.. :hehe:

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • Yeah - altering a table with a million records through the GUI = brave man

  • Hey!!!!!!!!! script the table using Database publishing wizard which gives you both the schema & objects (values). Drop the exisiting table. Re-design the index and do the rest of the modifictions. If you are admin, remotely access the server. Get into the query analyzer... Run through the script. This will solve the issue.

  • Change the timeout expire limit & try to alter the table schema by query

    🙂

  • Try through using CUI not through GUI

    ex.

    Alter Table Person

    Alter Column Person_Add nVarchar(100) not null

    in my example Person_add is having a datatype varchar(100)

    so i modify it

    regards

    shashi kant chauhan

  • Doing it from GUI on a table with 1 million records will definitely take a toll. Well in 2005 also if you alter the table through management studio then it creates a new table and then copies the entire data to the new table and drops the old table(same like sql server 2000). So it will defnitely timeout.

    Do it through the query and it will not time out.

  • Personally I prefer to script these sorts of commands, because I keep the scripts as a log of the changes I've made to the database. Do it through the GUI and you're depending on your memory to "know" when something changed. In my case (at least) that's not something I want to depend on... 😀

    Steve G.

  • I also faced similar problem where I was using GUI to alter a column in my table. Since this table has a VarBinary(Max) column which stores large documents, I was not able to alter any field using the Management Studio.

    After reading this post from Shashi Kant I altered the column through TSQL, and it did the job in a blink of an eye.

    Thanks for your great hint.:-)

    Tariq Changgez

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply