SQL Server 获取表或视图结构信息

------------获取表或视图的结构信息(ObjName:表名或视图名)
Select o.name as Oname,c.name As name , t.name As type,c.Length As tlength From SysObjects As o , SysColumns As c , SysTypes As t 
Where o.type in ('u','v') And o.id = c.id And c.xtype = t.xtype and o.name=N'ObjName' 
Order By o.name , c.name , t.name , c.Length
posted @ 2012-09-06 10:28  小罗》  阅读(237)  评论(0编辑  收藏  举报