查询用户所有的表和类型

select * from sysobjects where name='noPriKey'

select * from sqlTest.dbo.personInfo

--查询所有的用户表
select * from sysobjects where xtype='U'and name<>'dtproperties' order by name

--查询所有的列
select* from sys.all_columns

--查询所有的定义类型
select * from sys.systypes

select t.name ,c.*from sys.all_columns c,sysobjects s, sys.systypes t
where s.xtype='U' and s.id=c.object_id
and c.user_type_id=t.xtype
order by c.object_id

posted on 2011-09-01 06:47  cfd406635982  阅读(300)  评论(0编辑  收藏  举报