如何列举数据库中的表?如何列举表中的字段?

imafool 2003-08-20 12:34:12
如何列举数据库中的表?如何列举表中的字段?
...全文
68 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
imafool 2003-08-21
  • 打赏
  • 举报
回复
谢谢。
pengdali 2003-08-21
  • 打赏
  • 举报
回复
不需要管这些系统表

拷贝你的data目录下的数据库文件,步骤:
停止sql服务或脱机-->拷贝你的data目录下的数据库文件
粘贴你的数据库文件到目标机上,步骤:
右键数据库-->所有任务-->附加数据库


企业管理器-->右键你的数据库-->所有任务-->生成SQL脚本-->选项-->所有对象-->OK

都可以.
imafool 2003-08-21
  • 打赏
  • 举报
回复
系统数据库是必须的吗?
imafool 2003-08-21
  • 打赏
  • 举报
回复
我可以删除系统表吗?

转移数据库至另一位置时需要保持哪些数据表?
pengdali 2003-08-20
  • 打赏
  • 举报
回复
如何列举数据库中的表?
select * from sysobjects where xtype='U' and status>0

如何列举表中的字段?
select name 列 from syscolumns where id=object_id('Table2')
CrazyFor 2003-08-20
  • 打赏
  • 举报
回复
Select Name from sysobjects where xtype='U'
sp_tables



Select name from syscolumns where Name='tablename'
sp_columns

zhonghua79 2003-08-20
  • 打赏
  • 举报
回复
Select Name from sysobjects where xtype='U'

Select name from syscolumns where Name='tablename'
能解释一下吗,谢谢!

NAME指的是什么名字,SYSOBJECTS指的是系统的什么对象,还有SYSCOLUMNS指的是什么列

WHERE不是条件子句吗,这样的用法叫什么啊
97866 2003-08-20
  • 打赏
  • 举报
回复
Select Name from sysobjects where xtype='U'

Select name from syscolumns where Name='tablename'
hjb111 2003-08-20
  • 打赏
  • 举报
回复
sp_tables
select name from sysobjects where xtype='u' and stauus>0

sp_columns 'yourtable'
select name from syscolumns where id=object_id('yourtable')
hjb111 2003-08-20
  • 打赏
  • 举报
回复
sp_tables
select name from sysobjects where xtype='u' and stauus>0

sp_columns 'yourtable'
select name from syscolumns where id=object_id('yourtable')

34,576

社区成员

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

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