查询数据库中所有表名select table_name from information_schema.tables where table_schema='数据库名' and table_type='base table';查询指定数据库中指定表的所有字段名column_nameselect column_name from information_schema.columns where table_schema='数据库名' and table_name='表名'; #查看分布式系统中不同…
SQlserver获得列名,列类型,列类型长度,scale,prec等数据类型(syscolumns,systypes,sysobjects均为视图) select a.name as colname, b.name as typename,a.length as length,a.scale as scale,a.prec as prec from syscolumns a,systypes b ,sysobjects c where a.xusertype=b.xusertype and a…
原文地址:http://blog.csdn.net/pukuimin1226/article/details/7687538 ----查询数据库中用户创建的表 ----jsj01 为数据库名 select name tablename from jsj01..sysobjects where type='U' and name not in ('dtproperties') --查询表里的字段信息 exec sp_help 对象名 ---docs为表名 select * from syscolu…
意:本篇文章仅适用于mysql和postgre这两种数据库 1.查询数据库中所有表名及对应表的详细信息 select * from INFORMATION_SCHEMA.tables 2.根据指定名称查询表名(也可模糊查询,可查询表的详细信息) select * from INFORMATION_SCHEMA.tables where table_name = 'eguid'; select * from INFORMATION_SCHEMA.tables where table_name l…
#!/bin/bash # 假设将sakila数据库名改为new_sakila # MyISAM直接更改数据库目录下的文件即可 mysql -uroot -p123456 -e 'create database if not exists new_sakila' list_table=$(mysql -uroot -p123456 -Nse "select table_name from information_schema.TABLES where TABLE_SCHEMA='sakila'&…