List Tables Used In Queries

D

DavidS

I have a complex database that has about 40 queries. I need to locate all
instances where a certain table is used in a query. Is there someway to do
this without manually opening each query and inspecting it?
 
O

Ofer

Try this, using the system objects

SELECT MSysObjects.Name
FROM MSysObjects INNER JOIN MSysQueries ON MSysObjects.Id =
MSysQueries.ObjectId
WHERE (((MSysQueries.Name1) Like "*" & [Enter Form Name] & "*"));
 
O

Ofer

The prev post will display a part of a name, if you want exact name, then use

SELECT MSysObjects.Name, MSysQueries.Name1
FROM MSysObjects INNER JOIN MSysQueries ON MSysObjects.Id =
MSysQueries.ObjectId
WHERE MSysQueries.Name1 = [Enter Form Name]
 
D

DavidS

WOW! This was a wonderful timesaver! Thanks



Ofer said:
The prev post will display a part of a name, if you want exact name, then use

SELECT MSysObjects.Name, MSysQueries.Name1
FROM MSysObjects INNER JOIN MSysQueries ON MSysObjects.Id =
MSysQueries.ObjectId
WHERE MSysQueries.Name1 = [Enter Form Name]

--
I hope that helped
Good luck


DavidS said:
I have a complex database that has about 40 queries. I need to locate all
instances where a certain table is used in a query. Is there someway to do
this without manually opening each query and inspecting it?
 
Top