在Sql Server中用Sql语句列出系统对象(System Objects)

备忘。

列出数据库中的用户表

select name, id, crdate, refdate
from sysobjects
where (xtype = 'U') AND (status & 0xC0000000 <> 0xC0000000)

列出某用户表中的字段

select name colname, type_name(xusertype) tpname, length, 
prec, scale, isnullable, collation, colorder
from syscolumns
where id = object_id('表名')
order by colorder

作者: 杰棍 [Jegwon]

波波坡原创文章 链接:http://www.bobopo.com/article/code/sql_system_objects.htm

标签:

关键词: Sql Server, Microsoft, 系统对象, Sql, System Objects

创建日期: 2008-01-01

文库 微博 博客 作品 首页