sql查询语句
2016-06-11 16:38
239 查看
//查询表的字段名和字段类型
select column_name,data_type from information_schema.columns
where table_name = '表名'
//查询数据库对应的所有表名
select [id], [name] from [sysobjects] where [type] = 'u' order by [name]
//查询数据库所有数据库名
//1.链接字符串
Data Source=.;Initial Catalog=master;Integrated Security = SSPI;
//2.查询语句
SELECT Name FROM Master..SysDatabases ORDER BY Name
select column_name,data_type from information_schema.columns
where table_name = '表名'
//查询数据库对应的所有表名
select [id], [name] from [sysobjects] where [type] = 'u' order by [name]
//查询数据库所有数据库名
//1.链接字符串
Data Source=.;Initial Catalog=master;Integrated Security = SSPI;
//2.查询语句
SELECT Name FROM Master..SysDatabases ORDER BY Name
相关文章推荐
- php memcache扩展
- SQL sever语句对数据库的基本操作新增、删除、修改、查看等操作
- SQL SERVER与C#中数据类型的对应关系
- 一对一关联查询时使用relation连贯操作查询后,调用getLastSql()方法输出的sql语句
- Mysql日志文件
- 终端创建sqlite
- SQL Server 2008--查询(2)--Distinct
- mysql中MAX()函数MIN()函数
- mysql中AVG()函数
- Oracle数据库连接字符串(各种版本)
- mysql sum()函数
- MySQL查询高速缓冲学习
- mysql免密码登录, 及使用-e 参数执行sql脚本
- mysql -uroot -proot tc -e "select * from merchandise limit 1"这个-E的命令作用是什么,用来什么什么的?
- 数据库&MYSQL&JDBC
- MySQLl-更改生产线上MySQL数据字符集的方案
- Redis入门学习笔记一
- 数据库基础
- MySQL 日期格式化
- mysql导入导出sql文件