select name from sysobjects where xtype='U'--用户表名称

解决方案 »

  1.   

    select name from sysobjects where xtype='S'--系统表名称
    select name from sysobjects where xtype='V'--视图名称
      

  2.   

    --不知道你说的存储过程是否这个?--调用你说的那个存储过程来实现,以查询 pubs 库为例
    use pubs
    go--列出系统表
    EXEC sp_tables null, dbo, pubs, "'SYSTEM TABLE'"--列出用户表
    EXEC sp_tables null, dbo, pubs, "'TABLE'"--列出视图
    EXEC sp_tables null, dbo, pubs, "'VIEW'"
      

  3.   

    --直接从系统表中查询的话--列出当前库中的所有用户表
    select 表名=name
    from sysobjects
    where xtype='U' and status>=0
    --列出当前库中的所有系统表
    select 表名=name
    from sysobjects
    where xtype='S'
    --列出当前库中的所有视图
    select 表名=name
    from sysobjects
    where xtype='V'
    --列出当前库中的所有用户视图
    select 表名=name
    from sysobjects
    where xtype='V' and status>=0