sql server:
1.查询数据库中所有表名称:

select table_name from information_schema.tables where TABLE_CATALOG=‘数据库名称’;(包含视图)

select table_name from information_schema.tables where TABLE_CATALOG=‘数据库名称’ and table_type = ‘BASE TABLE’

2.查询每张表中所有字段名:

select COLUMN_NAME from INFORMATION_SCHEMA.Columns where table_name=‘表名称’ and TABLE_CATALOG=‘数据库名称’;

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐