dbTalk Databases Forums  

Re: Increase Column Size on Live DB

microsoft.public.sqlserver.setup microsoft.public.sqlserver.setup


Discuss Re: Increase Column Size on Live DB in the microsoft.public.sqlserver.setup forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joe Montana
 
Posts: n/a

Default Re: Increase Column Size on Live DB - 05-15-2004 , 08:12 AM






If I recall correctly, if you *shorten* the length of a char/varchar column
you must first drop any indexes on it.

Bill Blakey



"Kalen Delaney" <replies (AT) public_newsgroups (DOT) com> wrote

Quote:
rg

Increasing the max length of a varchar column is a metadata only change,
so
the impact on the system will be negligible.

There are some ALTER TABLE variations that actually go through and change
all the data in the table right at that point, but this is not one of
them.

If you subscribe to SQL Server Magazine, you can check out my January
column
which discusses which ALTER TABLEs are metadata only and which aren't.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com


"Binder" <rgondzur (AT) NO_SPAM_aicsoft (DOT) com> wrote in message
news:#2R4IPEOEHA.3380 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Actually, what I am asking about is the fact of changing the column in a
live environment and what are the issues, if any?

In addition, there are indexes defined against these columns.
Do the indexes need to be recreated after the column size is increased?
If so, how do I want to manually recreate them?

Rg





"Keith Kratochvil" <sqlguy.back2u (AT) comcast (DOT) net> wrote in message
news:uCligHEOEHA.1272 (AT) tk2msftngp13 (DOT) phx.gbl...
ALTER TABLE?

example:
ALTER TABLE foo ALTER COLUMN SomeColumn varchar(20)
This statement modifies the column SomeColumn within foo to a
varchar(20).


--
Keith


"Binder" <rgondzur (AT) NO_SPAM_aicsoft (DOT) com> wrote in message
news:%23YWo$oDOEHA.3052 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
I want to double the length of varchar column on several tables of a
live
database.
What are the recommended steps to perform this?

Thanks









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.