是否可以在每个表的每个字段中搜索sql中的特定值? [英] Is it possible to search every field of every table for a particular value in sql?

查看:62
本文介绍了是否可以在每个表的每个字段中搜索sql中的特定值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友....


是否可以在每个表的每个字段中搜索sql中的特定值?



请帮我...

如何做到这一点....

hello friends....


Is it possible to search every field of every table for a particular value in sql?



Please Help me...

How to do this....

推荐答案

看看下面的链接.

搜索数据库的所有表,行和列中的字符串
Have a look at below link.

Search for a string in an all the tables, rows and columns of a DB


您好,我想您可以.

首先,获得表的列名,然后,对每个列名进行一些选择查询.但是考虑到性能,我觉得这很可怕.

这是代码段的链接,该代码段获取特定表的列名.
http://weblogs.sqlteam.com/joew/archive/2008/04/27/60574.aspx [ ^ ]

我忘了,您还想要数据库中的每个表.在那种情况下,我想这足以在信息模式中查找表名,类似于我的链接中的描述.之后,使用表名查找列名,最后可以使用选择查询.
Hello, I think you can.

First, you get the column names for table, and after that you do some select queries for every column name. But it seems to me horrible considering the performance :).

This is a link to a code snippet, that gets column names for a specific table.
http://weblogs.sqlteam.com/joew/archive/2008/04/27/60574.aspx[^]

I forgot about, that you also want every table in database. In that case, I suppose that is enough to look up table names in information schema, similar to the description in my link. After that, using table names you lookup the column names and finally you can use select queries.


这篇关于是否可以在每个表的每个字段中搜索sql中的特定值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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