1、查看表的信息
sp_help '表名'
2、查看表结构
SELECT syscolumns.name,systypes.name,syscolumns.isnullable, syscolumns.length
FROM syscolumns, systypes
WHERE syscolumns.xusertype = systypes.xusertype AND syscolumns.id = object_id ( ' 表名 ' )
3、单独查询表的递增字段
select [ name ] from syscolumns where id = object_id (N ' 表名 ' ) and COLUMNPROPERTY (id,name, ' IsIdentity ' ) = 1
4、获取表主外键约束
exec sp_helpconstraint ' 表名 '
5、查看视图、函数、存储过程
sp_helptext 视图、函数、存储过程