473,785 Members | 2,919 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4139
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*******@disc ussions.microso ft.com> wrote in message
news:7D******** *************** ***********@mic rosoft.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*******@disc ussions.microso ft.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.adone t>

--
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*******@disc ussions.microso ft.com> wrote in message
news:7D******** *************** ***********@mic rosoft.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
2404
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 two, and sometimes by three. There won't always be a second and third ingredient to search on. It will depend on how the user wants to search. The database set up with multiple tables mainly one for all the details related to the recipe and...
4
12992
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 1989. I need to be able to 1) Go to a Search for 2) Enter Criteria -(Client_Last_Name) (Client_First_Name) (File_Number)
3
1808
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 of which are: TableMembers: (containg fields Refs, DateCreated, MembershipNo, OfficeLocation ...NB: Refs has a Primary Key - No Duplicates) TablePeople: (containing fields: Refs, Name, Addr, TelHome, TelWork, TelMobile & TelFax)...
8
3222
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 'search' may be clicked on by the user and the user can then search all records by postcode. I want to do this to prevent duplicate data entry.
1
5269
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 entire tables collection and returns the table name and column name where the word is found, otherwise returns "Not Found" Any help with this greatly appreciated. RBollinger
5
4186
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 database. I am searching two tables. SELECT TapeRecords.Id, TapeRecords.ItemTitle, TapeRecords.SourceRef,
4
3565
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. Does anyone know if this can be done? Thanks
0
1242
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 each record, I see the question and who submits the question. I can also modify the fields of both tables. However, when I want to add a new question, I can start filling out the
1
11700
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. I am using MS Access 2003. This is what I am looking for: A text field for the user to enter the search string or keyword.
8
1141
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 project. In the dataset I created 2 tables - and set some fields on the tables. In each table I set one of the fields to be a primary key / unique auto incremenet. So now I create a form, add a datagrid view to it and add to the dataset.
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.