Michael J Swart - Altering Text Columns: Only a Metadata Change?
Say you want to change the type of a text column using the ALTER TABLE … ALTER COLUMN syntax. It is valuable to know how much work SQL Server will have to do to fulfill your request. When your tables are large, it can mean the difference between a maintenance window that lasts five minutes, or one that lasts five hours or more.
I give a list of exactly when you’ll feel that pain and when you won’t.
...
When is the Whole Table Processed?
Here are conditions which require processing the entire table:
...
What’s Changes are Metadata Only Changes?
That’s a lot of conditions! What’s alterations are left?
...
What I found interesting was that there were some cases you could change/update a columns data type in-place. I think one of the bigges was the note about text/ntext to varchar(max)/nvarchar(max). Knowing that bit would have helped manage some fears I've had on upgrading those in the past. Learn something new ever day.
No comments:
Post a Comment
NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...
ALL comments are moderated. I will review every comment before it will appear on the blog.
Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...
I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...
Please see my comment policy for more information if you are interested.
Thanks,
Greg
PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...