Mark, Thursday, September 19, 2002, 12:24:45 PM, you wrote: MC> Can I change the data type of a column in a table from varchar(10) to MC> smallint(5) unsigned zerofill. The column that is set to varchar(10) is MC> populated with values from a primary key column in another table that has a MC> datatype smallint(5) unsigned zerofill and I need to make them both the MC> same. I administer my MySQL database from the command line and just need to MC> know MC> the syntax for changing data types. Also, can I do this without affecting MC> the data that is currently in the varchar(10) column (this data has came MC> from a column of the data type that I wish to change to)?
Yes, you can do it with ALTER TABLE .. MODIFY .. . If varchar(10) column contains allowable values for SMALLINT(5) UNSIGNED ZEROFILL, there shoudn't be a problem: http://www.mysql.com/doc/en/ALTER_TABLE.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.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