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

你可能感兴趣的:(SQL Server)