select top 0 * from 表

解决方案 »

  1.   

    select * from 表 where 1=2
      

  2.   

    select d.name,a.name ,b.name ,a.length, a.isnullable from syscolumns a, systypes b,sysobjects d where a.xtype=b.xusertype and a.id=d.id and d.xtype='U'
      

  3.   

    yourdabasename----->右键--->所有任务----->生成sql脚本---->自己看着办!!
      

  4.   

    CREATE PROCEDURE OZY_TableInfo
    @TableName as varchar(30)
     ASselect a.name as '字段',b.name as '类型',a.length as '长度' 
    from sysobjects as c 
    left join syscolumns as a on c.id = a.id
    left join systypes b on a.xtype = b.xtype 
       where c.name = @TableNameGO
      

  5.   

    select d.name,a.name ,b.name ,a.length, a.isnullable 
    from syscolumns a, systypes b,sysobjects d 
    where a.xtype=b.xusertype and a.id=d.id and d.xtype='U' and d.status>0