譬如
select * from table1 as a,table2 as b where a.id=b.id会查询出两个表的列头,有没有办法得到列头的名称和大小呢?

解决方案 »

  1.   

    ?????select * from syscolumns where id = object_id('table1')?????
      

  2.   

    列头的大小指的是什么 len?
      

  3.   

    select * from syscolumns where id = object_id('table1')
      

  4.   


    多表联查有表名吗?列的大小譬如说select name from users
    name字段能存储字符串的大小。
      

  5.   


    --查询某个表名的字段名和长度,如:
    select 列名=name,长度=length from syscolumns 
    where id=OBJECT_ID('表名')
    --需求是这样?
    select 列名=name,长度=length from syscolumns 
    where id=OBJECT_ID('table1') or id=object_id('table2')
      

  6.   

    因为我创建了一个存储过程,想传入一条sql语句包括多表联查的,灵活创建一个临时表,不知道有没有办法实现。
      

  7.   

    创建临时表,用select into
    select * into #tb from users where 1<>1
    --#tb为临时表