Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Altering column size

Status
Not open for further replies.

nkm

Programmer
May 27, 2001
45
US
How can I alter the column size for an existing table and not loose any data in it.


thanks
 
Hi
Assume the following:

Code:
CREATE TABLE testing123 (
    someField varchar(100)
)


You can modify the size like so:

Code:
ALTER TABLE testing123 MODIFY someField varchar(40)


This changes the size from varchar(100) to varchar(40)

Hope this helps.

-=-=-=-=-=-=-=-=-
For ease of reading, any posted CODE should be wrapped by [ignore][COLOR]
and
Code:
[/ignore] tags.

Ex:
Code:
SELECT 1 from sysobjects


TGML reference: ]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top