oracle查看表名 select table_name from user_tables; select table_name from dba_tables; select * from all_all_tables oracle查看数据库名 select * from v$database; mysql查看表名: show tables: mysql查看数据库名: show databases;
查询表的所有列及其属性:select t.*,c.COMMENTS from user_tab_columns t,user_col_comments c where t.table_name = c.table_name and t.column_name = c.column_name and t.table_name = women;查找表的主键:select cu.* from user_cons_columns cu, user_constraints au where cu.cons
1.获取所有数据库名: 2.Select Name FROM Master..SysDatabases order by Name 3. 4.2.获取所有表名: 5. (1) 6.Select Name FROM SysObjects Where XType='U' orDER BY Name 7. XType='U':表示所有用户表; 8. XType='S':表示所有系统表; 9. (2) 10.SELECT n
SELECT表名=case when a.colorder=1 then d.name else '' end,--表说明=case when a.colorder=1 then isnull(f.value,'') else '' end,--字段序号=a.colorder,字段名=a.name,标识=case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end,主键=case when exists(SEL
查询数据库 select * From master.dbo.sysdatabases where name='数据库名' and status<>512 --读取库中的所有表名 (当前数据库)select name from sysobjects where xtype='u' --读取指定表的所有列名 select name from syscolumns where id=(select max(id) from sysobjects where xtype='u' and name
SELECT ii.`COLUMN_NAME` FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ii WHERE ii.`CONSTRAINT_SCHEMA`='xius' AND ii.`TABLE_NAME`='comment_user' AND ii.`REFERENCED_COLUMN_NAME` != 'null'; xius: 数据库名 comment_user: 表名
SHOW TABLE STATUS FROM `DB_NAME` WHERE ENGINE IS NOT NULL; SHOW TABLE STATUS FROM `DB_NAME` WHERE NAME IN ('table_1','table_2') AND ENGINE IS NOT NULL;