select a.name from syscolumns a,sysobjects b where a.id=b.id and b.name='a'

解决方案 »

  1.   

    select name 列 from syscolumns where id=object_id('Table2')
      

  2.   

    select name 列 from syscolumns where id=object_id('A表')
      

  3.   

    Create view fielddesc    
    as    
    select o.name as oname, c.name as cname,convert(varchar(30),p.value) as value,p.smallid as psmallid,t.name as tname 
    from syscolumns c  
    join systypes t on c.xtype = t.xtype
    join sysobjects o on o.id=c.id 
    left join    sysproperties p on p.smallid=c.colid and p.id=o.id    
    where o.xtype='U'    
      

  4.   

    select c.name as 字段名
    ,t.name 数据类型
    ,c.prec as 长度
    ,p.value as 字段说明
    ,m.text as 默认值
    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
    left join
    syscomments m
    on c.cdefault=m.id
    where objectproperty(c.id,'IsUserTable')=1 and c.id=object_id('A表')