sql 查询某字段为空 select * from 表名 where 字段名 is null sql 查询某字段不为空 select * from 表名 where 字段名 is not null sql查询字段1为空且字段2不为空的数据 select * from 表名 where 字段名1 is null and 字段名2 is not null…
查询数据库里所有表名和字段名的语句SQL 查询所有表名:SELECT NAME FROM SYSOBJECTS WHERE TYPE='U'SELECT * FROM INFORMATION_SCHEMA.TABLES查询表的所有字段名:SELECT NAME FROM SYSCOLUMNS WHERE ID=OBJECT_ID(' 表名' )SELECT * FROM INFORMATION_SCHEMA.TABLESSELECT * FROM INFORMATION_SCHEMA.VIEWS…