黑马程序员技术交流社区

标题: 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   




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2