我这没有帮助文件和sql server,不方便我简单写下可能有点问题,你在稍改下select c.name as 字段 , t.name as 类型, c.length as 长度 ,cast(m.value as nvarchar(255)) as 描述 , c.colid as 字段ID
from syscolumns c
inner join sysobjects o on o.id = c.id
inner join systypes t on c.xtype = t.xtype
left join sysproperties m on c.id =m.id and c.colid = m.smallid
where o.xtype = 'U' and o.name <> 'dtproperties' and t.status <> 1
from syscolumns c
inner join sysobjects o on o.id = c.id
inner join systypes t on c.xtype = t.xtype
left join sysproperties m on c.id =m.id and c.colid = m.smallid
where o.xtype = 'U' and o.name <> 'dtproperties' and t.status <> 1
systypes
sysproperties
sysobjects
这四表都是系统表,在库MATER中,你可以在那里找,具体他们的字段描述,你看一下,SQL SERVER的帮助。我也记 不全。我都是用的时候现看的。不过,你去的那家公司很变态啊。居然考你这个。如果公司不打,赶快走吧。
, c.name as 字段
,t.name as 类型
,c.length as 长度
,p.value as 描述
,c.colid as 字段id
from syscolumns c
inner join
systypes t
on c.xusertype=t.xusertype
left join
sysproperties p
on c.id=p.id and c.colid=p.smallid
where c.id in
(select id from sysobjects where xtype='U')
liuyunfeidu(飞龙) 说的不对,自己的库里就有
zjcxc(邹建) 效率低一点点我写的应该可以,又看一下,好像没错
这个问题,我已经做好了
谢谢你们的帮忙。