下面列出:1.增加一个字段alter table user add COLUMN new1 VARCHAR(20) DEFAULT NULL; //增加一个字段,默认为空alter table user add COLUMN new2 VARCHAR(20) NOT NULL; //增加一个字段,默认不能为空2.删除一个字段alter table user DROP COLUMN new2; //删除一个字段3.修改一个字段alter table user MODIFY new1 VARCHAR
数据库表之前的引擎是MyISAM,影响事务操作,要改成Innodb引擎 查询表引擎 SELECT CONCAT(table_name,' ', engine) FROM information_schema.tables WHERE table_schema="表名" AND ENGINE="MyISAM"; 生成修改sql select CONCAT('alter table ',table_name,' engine=InnoDB;') FROM informa
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class _Default : Sys