April 24, 2009 at 9:51 am
I am using the server management studio and am trying this query which takes over an hour for each field: (I have to do this for 6 fields). Table has 20 million records
ALTER TABLE largetable ALTER COLUMN CLAIM_NUMBER nvarchar(255)
Is there any savings on time if I combine the field modifications into one statement or should I continue to run seperate queries for each field and wait the 1 hours for each query to complete?
Thanks for any help
April 24, 2009 at 9:52 am
I may be mistaken, but I don't think you can combine multiple alter column statements into a single command.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 24, 2009 at 11:18 am
I just tried it... you can't combine them.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 24, 2009 at 11:47 am
20 million rows is not really a lot these days. One thing you could do is create a new table with the columns structured the way you want, insert the 20 million rows - drop the old table, rename the new table.
Basically, this is exactly what SSMS would do for you behind the scenes.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
April 24, 2009 at 1:00 pm
OK - I'll try that, thanks
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply