如何用sql语句获得此数据库下的所有表?

chendd2001 2003-05-07 01:59:50
如何用sql语句获得此数据库下的所有表?
...全文
54 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
mjhnet 2003-05-08
  • 打赏
  • 举报
回复
exec sp_tables

还会返回系统表
erigido 2003-05-07
  • 打赏
  • 举报
回复
exec sp_tables
ldcr520 2003-05-07
  • 打赏
  • 举报
回复
select name from sysobjects where type='U'
sp_tables
joygxd 2003-05-07
  • 打赏
  • 举报
回复
select name from sysobjects where xtype='u' and status>0
CrazyFor 2003-05-07
  • 打赏
  • 举报
回复
exec sp_tables
mjhnet 2003-05-07
  • 打赏
  • 举报
回复
select name from sysobjects where type='U'

就是会多一个dtproperties表

最好

select name from sysobjects where type='U' and name<>='dtproperties'
saucer 2003-05-07
  • 打赏
  • 举报
回复
select name from sysobjects where type='U'

in 2000, you could also do

select table_name from INFORMATION_SCHEMA.TABLES where table_type = 'BASE TABLE'

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧