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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to alter SQL to exclude System Tables

Status
Not open for further replies.

missinglinq

Programmer
Feb 9, 2002
1,914
US
I'm using the statement below to retrieve the names of the tables in a db into a combobox, but need help to figure out how to exclude the system tables such as MSysObjects, MSysACEs, MSysQueries and so forth.

SELECT [MSysObjects].[Name]
FROM MSysObjects
WHERE ((([MSysObjects].[Name]) Not Like "~*") And (([MSysObjects].[Type])=1));

Thanks!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
SELECT [Name]
FROM MSysObjects
WHERE [Name] Not Like '~*' AND [Name] Not Like 'MSys*' AND [Type]=1;

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks, PHV!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
The ~ isn't a wildcard character
Temporary tables or embedded queries have name beginning with a tilde.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top