From: Christian Mack Date: April 15 1999 11:11am Subject: Re: ALTER TABLE List-Archive: http://lists.mysql.com/mysql/1895 Message-Id: <3715C968.1874C919@compal.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit efrazier@stripped wrote: > > HI, > > sorry this is a little pathtic, but I can't seem to get ALTER TABLE to work. > Could someone please send me an example of something simple like how to > change a column from a CHAR(255) to a VARCHAR(20). I don' care so much about > renaming columns and so on just changing their types. Hopefully without > distroying anything :) > > Thanks, > > Eric Hi Eric That's simple: ALTER TABLE yourTableName CHANGE columnName columnName VARCHAR(20); If your contents in the changed column is shorter or equal 20 chars you won't loose anything. If its longer it will be truncated to20 characters. You can test for this before changing with: SELECT MAX( LENGTH(columnName) ) FROM yourTableName; Tschau Christian