在数据库的未知表中查找特定列条目? [英] Find a specific column entry in an unknown table in a database?

查看:36
本文介绍了在数据库的未知表中查找特定列条目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个话题(在数据库中的未知表中查找特定列?)和我的问题非常相似.我需要的查询与这个非常相似(我认为):

I'm aware of this topic ( Find a specific column in an unknown table in a database? ) and my problem is quite similar. The query I need is quite similar to this one (I think):

SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE column_name LIKE '%watcher%'

但我需要的是列名未知的查询,但我知道内容是什么,我想找出表/列的名称.(我知道这听起来很奇怪:-/).我这可能吗?

But what I need is a query where the column name is unknown, but I know what the content will be and I want to find out what the name of table/column is. (I know this sounds strange :-/ ). I this possible?

推荐答案

尝试使用 ApexSQL Search – 它同时搜索对象和数据,它是一个类似于 Red Gate 的 SQL 搜索的免费工具.

Try using ApexSQL Search – it searches for both objects and data and it’s a free tool similar to SQL Search from Red Gate.

如果您不想使用第三方工具,另一种选择是使用游标遍历所有表中所有列的查询,但我担心它会变得过于复杂和性能密集.

Another option if you don’t want to deal with third party tools is query that will use cursors to iterate through all columns in all tables but I’m afraid that it would turn out too complex and performance intensive.

这篇关于在数据库的未知表中查找特定列条目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆