ask - search a text in whole database
hi there..
I need help. I use visual basic 6. I want to make program that can search text in one database (SQL). that text can be as record or field.
in one database there is many table, so I want to make program that can search for a text in each record in each fieldname in each table in one database, can I?
also, I want search for a text in each fieldname in each table in one database, can I?
Database is stored in sql 2000.
thanks before
Re: ask - search a text in whole database
That is possible but why do you want such?
Re: ask - search a text in whole database
because we have application that use database, and that database stored in sql server. there is an error when application call data from that database to make a report. I know what string I must search, but I don't know where that string stored.
may you explain me how to do that?
thanks
Re: ask - search a text in whole database
Why don't you know what table and column to search for a specific data? Searching each column of each table would be a lengthy process and you have to consider that they are using different data types also.
Re: ask - search a text in whole database
ok, that application built by someone, and that person hard to be contacted. As I know, all data types are string.
If we wait until we can reach that person, it will hold so much our tasks.
that's why we need code like that. thanks
Re: ask - search a text in whole database
How long do you have? What would be the expectation of the amount of time to search each field of each record of each table for a work or phrase that in anywhere in it?
Re: ask - search a text in whole database
I have a task until end of december (before dec 25), because this is not only my job, I hard to spend more time for search this. So I think I can make small application that can search what I want, meanwhile I do my other task.
thanks
Re: ask - search a text in whole database
hello....no one want help me?
Re: ask - search a text in whole database
hello???
where are you all???
I need this code...
oh boy, my boss has angry to me.
Re: ask - search a text in whole database
The question I asked was retorical.... on time anyway. What about the rest... Is the phrase at the beinging of the field, the end of the field or anywhere in the field?
The time ask was this will take a very long time to perform.... You are doing a wild card seach of the entier database. That is a long and costly process... You can limit the seach some what if you exclude columns that are numerical,date,image or binary types.
I'm working also.... This is not my job to do yours.
Re: ask - search a text in whole database
You can do a search on how to enumerate the tables and how to enumerate all the fields in a table.
Re: ask - search a text in whole database
to GaryMazzone,
hi, I'm really sorry, I don't mean to act like that :(
anyway, all fields are string. thanks
Re: ask - search a text in whole database
The like this Select * from tablename where fieldname like '%whaterveryouarelookingfor%'
This needs to be done for every field in every table. I hope you do not have a lot of tables with a lot of fields and a lot of rows. This will take a long time to finish
Re: ask - search a text in whole database
CHARINDEX could also be used to determine the existence of a string in another string.
Re: ask - search a text in whole database
Quote:
Originally Posted by
GaryMazzone
The like this Select * from tablename where fieldname like '%whaterveryouarelookingfor%'
This needs to be done for every field in every table. I hope you do not have a lot of tables with a lot of fields and a lot of rows. This will take a long time to finish
that's the problem, yes we have a lot lot lot fields and rows.. :(
Why I think I need search tool like this.