不知道为什么在地球上你会想要它,但它有可能:
DELIMITER // DROP PROCEDURE foo// CREATE PROCEDURE foo(IN MYTABLE varchar(50) , IN COLNAME varchar (50), IN MYTYPE varchar(50)) BEGIN SET @ddl = CONCAT('alter table ', MYTABLE, ' add column (', COLNAME, ' ', MYTYPE, ')'); PREPARE STMT FROM @ddl; EXECUTE STMT; END; //