标题: Sql server怎么获得一个表中的所有字段 [打印本页] 作者: 王明明1004 时间: 2013-5-16 17:41 标题: Sql server怎么获得一个表中的所有字段 SELECT name FROM syscolumns WHERE id=Object_Id('itcastsim.dbo.Person');
这个查询不出来作者: 淡蓝色 时间: 2013-5-16 23:36
获得表的所有字段
selectc.name,t.name,c.xprec,c.xscale,c.isnullable
from systypes t,syscolumns c
where t.xtype=c.xtype
and c.id = (select id from sysobjects where name='YourTableName')
order by c.colid