如何查找整个数据库的所有表中的某个字段?

bct_titus 2007-08-17 11:08:07
比如说有一个数据库中有一个字段uuid = 40f128ba-fd52-46a7-9856-622f8cf33d3e,
但是数据库中有上百个表,几乎每个表都有uuid这个字段,怎么样查找出来这个未知表的uuid=40f128ba-fd52-46a7-9856-622f8cf33d3e 的记录呢?
...全文
766 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Limpire 2007-08-21
  • 打赏
  • 举报
回复
那就分批查咯
bct_titus 2007-08-21
  • 打赏
  • 举报
回复
exec sp_MSforeachtable @command1 = "select * from ? where uuid = '40f128ba-fd52-46a7-9856-622f8cf33d3e'"
只能返回一百条记录,但是数据库中的表有上百个,系统报错:
The query has exceeded the maximum number of result sets that can be displayed in the results grid. Only the first 100 result sets are displayed in the grid.
请问如何解决?
mengmou 2007-08-17
  • 打赏
  • 举报
回复
exec sp_MSforeachtable @command1 = "select * from ? where uuid = '40f128ba-fd52-46a7-9856-622f8cf33d3e'"
mengmou 2007-08-17
  • 打赏
  • 举报
回复
sp_MSforeachtable @command1 = "select * from ? where uuid = '40f128ba-fd52-46a7-9856-622f8cf33d3e'"

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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