求一简单sql语句

st_2000 2005-01-27 10:02:35
取得某表的所有字段名
...全文
67 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Softlee81307 2005-01-27
  • 打赏
  • 举报
回复
select name from syscolumns where id=object_id(表名)
例子給你看,有一個表叫tc的
select name from syscolumns where id=object_id('tc')
--------就這樣子的
st_2000 2005-01-27
  • 打赏
  • 举报
回复
好像不行
flashasp 2005-01-27
  • 打赏
  • 举报
回复
select name
from syscolumns
where id=object_id('dv_bbs1')
Qihua_wu 2005-01-27
  • 打赏
  • 举报
回复

select a.NAME,c.name,a.LENGTH
from syscolumns a,sysobjects b,systypes c
where a.id = b.id and b.name='UT_SALARYITEM' and b.xtype = 'U' and a.xtype = c.xtype
Qihua_wu 2005-01-27
  • 打赏
  • 举报
回复
SELECT * FROM TABLENAME WHERE 1=2,显示所有字段名
Softlee81307 2005-01-27
  • 打赏
  • 举报
回复
select name from syscolumns where id=object_id(表名)
xluzhong 2005-01-27
  • 打赏
  • 举报
回复
select name
from syscolumns
where id=object_id('tablename)
zheninchangjiang 2005-01-27
  • 打赏
  • 举报
回复
select name from syscolumns where id=object_id('namedtable')

34,588

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧