Pada Tue, 30 Jul 2002 15:54:07 +0200 Ralf Narozny <[EMAIL PROTECTED]> menulis :
> Hello > > CREATE TABLE mytable_bak SELECT * FROM mytable; > ALTER TABLE mytable MODIFY mycol1 VARCHAR(20)...; > > Paul Maine wrote: > > >What SQL command can I use to change an existing column in a table with an > >integer data type to a varchar data type. This is a production table with > >about 3,000 records. I don't want to loose any of my current data in this > >column. I think there is no problem to just running the last : ALTER TABLE mytable MODIFY mycol1 VARCHAR(20)...; because from int -> char is no problem ... if there's, then the query just prompt an error message ... and no data will be lost ... ;-) but for extra backup, you can also do the first query :D -- Let's call it an accidental feature. -- Larry Wall MySQL 3.23.51 : up 39 days, Queries : 355.458 per second (avg). -- Dicky Wahyu Purnomo - System Administrator PT FIRSTWAP : Jl Kapt. Tendean No. 34 - Jakarta Selatan (12790) Phone : +62 21 79199577 - Web : http://1rstwap.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php