为什么要把字段设置成not null 呢? 1.空值是不占用空间的 2.mysql中的NULL其实是占用空间的,下面是来自于MYSQL官方的解释 “NULL columns require additional space in the row to record whether their values are NULL. For MyISAM tables, each NULL column takes one bit extra, rounded up to the nearest byt…
1.查询数据库中的所有数据库名: SELECT Name FROM Master..SysDatabases ORDER BY Name 2.查询某个数据库中所有的表名: SELECT Name FROM SysObjects Where XType='U' ORDER BY Name ==表中字段 1.方法一 SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='表名' 2.方法二 select a.name tablename,…
select * From master.dbo.sysdatabases where name='数据库名'select * from sysobjects where id = object_id('表名') //绝对不能有 master.dboselect * from syscolumns where name='列名' and id=object_id('表名') //绝对不能有 master.dbo 1.增加列: alter table tableName add columnN…