Thx!

解决方案 »

  1.   

    --所有用户表
    select [name] from sysobjects where xtype='U'
    --所有表
    select [name] from sysobjects where xtype='U' or xtype='S'
      

  2.   

    select name
    from sysobjects
    where type='u'
      

  3.   

    select name
      from  sysobjects
     where  type = 'U'
      

  4.   

    select * from sysobjects where xtype='U'
      

  5.   

    --取所有信息
    SELECT b.name '表名',a.colorder '序号',a.name '字段名',c.name '类型',a.length '长度',a.isnullable '空值',
    a.cdefault '默认值' FROM syscolumns a,sysobjects b,systypes c WHERE a.id=b.id  and b.xtype='u'
    and a.xtype=c.xtype order by b.name,a.colorder-----取表名SELECT distinct(b.name) '表名' FROM syscolumns a,sysobjects b,systypes c WHERE a.id=b.id  and b.xtype='u'
    and a.xtype=c.xtype order by b.name
      

  6.   

    sp_msforeachtable 'select ''?'' as ''表名'''