比如我有一张stu表字段为:学好,姓名,数学,语文,英语
那么我要取得表中第三个字段的字段名 (就是数学,因为我们这些课程动态创建的,所以实现是不能确定的)那么我该怎么写代码

解决方案 »

  1.   

    select name from syscolumns where id=object_id('stu') and colid=3
      

  2.   

    字段总数?
    select count(*) from syscolumns where id=object_id('stu')
      

  3.   

    xiexie 再看一下我发表的外面的关于字段的问题?帮我回答一下
      

  4.   

    select name from syscolumns where id=object_id(N'表名')and colid=列数