andy_tigger

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

//查询所有用户表

 
select * FROM sysobjects WHERE type='U' ORDER BY name
 
select * from sys.tables

 

select a.name AS '字段名',b.name AS '类型',a.length AS '长度'  from syscolumns a LEFT JOIN systypes b
ON a.xtype=b.xusertype
where a.ID = OBJECT_ID('表名')

 

select [name], [id] from sysobjects where [type] = 'U';

//查询所有系统表

select [name], [id] from sysobjects where [type] = 'S';

//列出数据表中的所有字段

select * from syscolumns where ID = OBJECT_ID('S_CityList');

//查询所有用户表中的非重复字段

select distinct [name] from syscolumns

where ID in (select id from sysobjects where [type] = 'U');

posted on 2010-07-20 16:03  andy_tigger  阅读(127)  评论(0编辑  收藏  举报