SQL Server 系统表使用-查询指定数据库中用户表及其列、数据类、长度
2006-04-19 13:09
931 查看
select t1.id,t1.name,t2.name,t2.xtype,
case when t2.xtype=56 or t2.xtype=61 then t3.name
else t3.name+'('+convert(varchar,t2.length)+')' end,
case when t2.isnullable=1 then ''
else 'Y' end
from sysobjects t1,syscolumns t2,systypes t3
where t1.xtype='U'and t1.id=t2.id
and t2.xtype=t3.xtype
--and t1.name='CompanyInfo'
order by t1.id,t2.colid
case when t2.xtype=56 or t2.xtype=61 then t3.name
else t3.name+'('+convert(varchar,t2.length)+')' end,
case when t2.isnullable=1 then ''
else 'Y' end
from sysobjects t1,syscolumns t2,systypes t3
where t1.xtype='U'and t1.id=t2.id
and t2.xtype=t3.xtype
--and t1.name='CompanyInfo'
order by t1.id,t2.colid
相关文章推荐
- mysql使用navicat给指定用户授权查看数据库中的某些数据表
- SQL Server 查询使用Linked Server查询其它数据库服务器的数据
- SQL 教程数据库包括:Oracle, Sybase, SQL Server, DB2, Access 等等,您将学到如何使用 SQL 访问和处理数据系统中的数据
- Android使用ContentObserver监听数据库变化 接受指定号码的短信,并且不让系统截取到通知用户
- Android使用ContentObserver监听数据库变化 接受指定号码的短信,并且不让系统截取到通知用户
- 地磅称量系统之(37~39) 直接向数据库的数据表WtBill添加测试数据以及绑定用户控件和使用编码的方式控制dataGridView控件的每列属性和添加数据数据库的表中不存在的字段(非绑定列)
- 使用sql server 2008 资源调控器限制指定用户查询所使用CPU资源
- asp.net查询数据库时提示使用的sql server版本不支持数据类型date
- sharepoint 2010 根据指定用户UserID查询该用户列表数据
- SQL Server 2008数据库中使用表值参数(用户自定义表类型)
- C# DataGgridView 控件绑定数据库sql server,查询数据,导出到Excel
- php新闻发布系统发布成功从数据库查询所有数据用表格显示出来03
- SQL使用数据库引擎存储过程,系统视图查询,DBA,BI开发人员必备基础知识
- 【知识积累】使用Oracl数据库删除表数据提示用户被锁定
- ORACLE用户常用数据字典的查询使用方法
- 13、SQL Server 使用子查询和CTE提供数据之简单子查询
- 如何查询Oracle,Sql Server,MySQL 中的数据库名称、数据表名称、字段名称
- 在 SQL Server 2008 中新建用户登录并指定该用户的数据库
- Sqlserver使用排名函数Row_Number()函数查询指定范围的数据
- 在SQL Server中 新建登录用户 并指定该用户登录的数据库及权限