Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL question

Status
Not open for further replies.

Pav1977

IS-IT--Management
Jul 5, 2006
59
GB
Hi there - I forgot my SQL book today and can't remember how to search all the tables in a database.
It requires to have FROM and is not taking *.

I know this is stupid - I'd much appreciate your help guys.

So it would be soething like this:
SELECT *
FROM - all tables in a database?
WHERE (PageId = '14061')

Regards
 
What do you want to do?
1) get a name of all tables in your database
2) search for a specific value in a specific column in multiple table


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Second option - search for specific value in a specific column in all of the tables.

Cheers
 
You can write code that loops through all the tables and builds a query FROM each table. You can also create a union query of the field from all table and create a query that searches the union query.

I can't imagine what type of system would need to search through the same field in multiple tables for a specific value.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Yes you are right - I just need to manually delete some corrupt data it's not to be reused ever again. This can wait now it seems - so I'll be alright once I have my book back.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top