List Tables Used In Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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] & "*"));
 
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]
 
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?
 
Back
Top