|
-
Dec 14th, 2008, 10:55 PM
#1
Thread Starter
Lively Member
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
-
Dec 15th, 2008, 12:34 AM
#2
Re: ask - search a text in whole database
That is possible but why do you want such?
-
Dec 15th, 2008, 09:42 AM
#3
Thread Starter
Lively Member
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
-
Dec 15th, 2008, 10:04 AM
#4
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.
-
Dec 15th, 2008, 09:59 PM
#5
Thread Starter
Lively Member
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
-
Dec 16th, 2008, 08:04 AM
#6
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?
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Dec 17th, 2008, 10:13 AM
#7
Thread Starter
Lively Member
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
-
Dec 20th, 2008, 06:51 AM
#8
Thread Starter
Lively Member
Re: ask - search a text in whole database
hello....no one want help me?
-
Dec 23rd, 2008, 10:35 AM
#9
Thread Starter
Lively Member
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.
-
Dec 23rd, 2008, 10:44 AM
#10
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.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Dec 23rd, 2008, 03:14 PM
#11
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.
-
Dec 24th, 2008, 11:58 AM
#12
Thread Starter
Lively Member
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
-
Dec 24th, 2008, 12:01 PM
#13
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
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Dec 24th, 2008, 07:24 PM
#14
Re: ask - search a text in whole database
CHARINDEX could also be used to determine the existence of a string in another string.
-
Apr 19th, 2009, 11:48 PM
#15
Thread Starter
Lively Member
Re: ask - search a text in whole database
 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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|