Increasing Varchar length (Quick Question)

  • I tested this but I wanted to confirm - if I increase the length of a varchar field using ALTER TABLE ... ALTER COLUMN, it only changes the table metadata right? I don't have to worry about massive IO and locking the table for a long time...

  • Yeah, that should be fine. Shrinking might cause more of a lock, but growing isn't usually a problem.

    - 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

  • Correct. Increasing the size is just a metadata operation. Reduce it and you could be in trouble 😉


    * Noel

Viewing 3 posts - 1 through 2 (of 2 total)

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