yinzhenyuan

一.mysql相关

1.查询所有的数据库

SHOW DATABASES;

2.列出当前数据库的所有表

show tables;

3.查询指定数据库中的所有表信息

select * from information_schema.tables where table_schema = \'ProductDB\' order by table_name;

4.查询指定表的字段总数

select count(*) from information_schema.columns where table_schema = \'ProductDB\' and table_name=\'Products_Core\';

二.sqlserver相关

1.查询所有的数据库

SELECT * FROM Master..SysDatabases ORDER BY Name;

2.列出当前数据库的所有表

SELECT * from sysobjects where xtype = \'U\' ORDER BY name;

3.列出指定表的字段总数

select count(*) from syscolumns where id=object_id(\'Products_Core\');

 

分类:

技术点:

相关文章: