473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Search all fields in all tables of a SQL Database

How can I seach all of the fields of every table in a databae for a particular value. When it is found, I want to be able to display the table name and the field name, then continue to search.
Nov 20 '05 #1
3 4128
The same way you would search a normal SQL table for all fields...

First, get the schema...

then... for each table... get a list of fields...

then for each row, validate against each field to see if the value is
there....

return...

move on...

The trick is of course, speed... And this is why indexes were invented.
"KRoy" <an*******@discussions.microsoft.com> wrote in message
news:7D**********************************@microsof t.com...
How can I seach all of the fields of every table in a databae for a

particular value. When it is found, I want to be able to display the table
name and the field name, then continue to search.
Nov 20 '05 #2
* "=?Utf-8?B?S1JveQ==?=" <an*******@discussions.microsoft.com> scripsit:
How can I seach all of the fields of every table in a databae for a
particular value. When it is found, I want to be able to display the
table name and the field name, then continue to search.


That's a typical question for the ADO.NET group:

<news:microsoft.public.dotnet.framework.adonet>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Hi KRoy,

It's quite an open-ended question. Like so many postings I end up asking
for a few more details. It is so atypical to think that somebody would want
to search every column of every table in a database for (for instance) the
word "computer" or something. Equals "computer" or contains "computer"?
Would you want it to match on the word "compute" also in that case?

If you could describe what it is that you are trying to do in a big picture
view it might be easier to propose a solution. Perhaps the answer is to
post the text values into a special "search" table in addition to posting in
the regular tables. Suddenly it becomes significantly easier since all
searching would be done in a single table on a single field. Table and
primary key information would be contained in the search table so you could
refer back to the original source.

So to answer your question, "it depends." :-)

Tom

"KRoy" <an*******@discussions.microsoft.com> wrote in message
news:7D**********************************@microsof t.com...
How can I seach all of the fields of every table in a databae for a

particular value. When it is found, I want to be able to display the table
name and the field name, then continue to search.
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: TH | last post by:
I am (still :) working on a recipe database. Now I am trying to figure out how to set it up for an ingredient search. What I want it to be able to do is to search by one ingredient, sometimes by...
4
by: Gobi | last post by:
Hello, I have a Database with lists of Clients in each. Every year a new tables is created with the naming convention "CloseYear" ie close1999, close2000 There are tables from this year back to...
3
by: Jan Szymczuk | last post by:
I am trying to create a query that will show me who is phoning who in an organisation from available Telephone Billing information. I am creating a MSAccess 2000 database with a few few tables, two...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
1
by: robboll | last post by:
Using MS Access 2003 I am looking for a function that will search the entire Tables Collection for a specific string in text or memo fields. For example if I enter "widget" it interrogates the...
5
by: JP SIngh | last post by:
Hi All This is a complicated one, not for the faint hearted :) :) :) Please help if you can how to achieve this search. We have a freetext search entry box to allow users to search the...
4
by: RoadRunner | last post by:
Hi, I have a question. I am asked to produce a global search of a given corporate name, in more that one database. Each database has different table names and different field names in the tables....
0
by: jakev2003 | last post by:
I have a form that has values from many different tables. Here are the tables: - Questions(ID, UserID, Question) - Users(UserID, Name, Email_Address, Other_Info) So when I browse through...
1
by: atl10spro | last post by:
Hello Everyone, I am new to MS Access and although I have created several different databases I lack the VB knowledge to code a search function. I am turning to your expertise for assistance. ...
8
by: Miro | last post by:
Hi sorry for the quick question. I am on the right track but just cant seem to find what to search for in my books / online for the answer I am looking for. I have created a dataset within my...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.