October 22, 2007 at 6:47 am
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
October 22, 2007 at 8:43 am
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 ?
October 22, 2007 at 9:34 am
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. SelburgOctober 23, 2007 at 3:17 am
Yeah - altering a table with a million records through the GUI = brave man
James Horsley
Workflow Consulting Limited
October 23, 2007 at 3:28 am
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.
October 23, 2007 at 3:43 am
Change the timeout expire limit & try to alter the table schema by query
October 23, 2007 at 3:57 am
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
October 23, 2007 at 7:25 am
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.
October 23, 2007 at 1:34 pm
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.
April 26, 2010 at 4:13 am
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
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy