首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

获取SqlServer2005表构造(字段,主键,外键,递增,描述)

2012-09-18 
获取SqlServer2005表结构(字段,主键,外键,递增,描述)2005Selectcol.[name]as 字段名,col.[length]as 长

获取SqlServer2005表结构(字段,主键,外键,递增,描述)
2005

Select     col.[name]  as '字段名',    col.[length]as '长度'  ,    type.[name] as '类型'  ,    pro.value   as '描述'   From syscolumns as col Left Join systypes as type on col.xtype = type.xtype Left Join sysProperties as pro on col.id = pro.id and col.colid = pro.smallid where col.id = (Select id From Sysobjects Where name = 'table name') 

具体参见:
http://www.cnblogs.com/eflylab/archive/2008/06/23/1227838.html

热点排行
Bad Request.