Solved

sql query to get list of all tables

Posted on 2002-04-12
8
1,521 Views
Last Modified: 2007-12-19
Any one know how to list all tables in a db using SQL
0
Comment
Question by:bearware
8 Comments
 
LVL 4

Expert Comment

by:mrorph
Comment Utility
Try:
Select TABLE_NAME,TABLE_TYPE from INFORMATION_SCHEMA.TABLES
0
 
LVL 3

Expert Comment

by:arun04
Comment Utility
which RDBMS are you taking about, this information is present in different data dictionary tables in various RDBMS

for oracle

select * from tab where tabtype = 'TABLE' ;


for sql server and sybase

select name from sysobjects where type = 'U'

0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
if you use ADO, you can use:

dim c as new ADODB.Connection
dim t as adodb.recordset
c.open "yourdatabaseparams"
set t = c.OpenSchema (adSchemaTables)

CHeers
0
 
LVL 4

Expert Comment

by:mrorph
Comment Utility
arun04:

I tested the statement on SQL server and I believe that it is ANSI 92 SQL and not RDBMS-specific.  I am not sure though.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
bearware, have you been helped here?  Is this the question you asked me about in the Community Support question?

Experts, is there anything further you can add here to help bearware?

Thanks,
Moondancer - EE Moderator
0
 
LVL 1

Author Comment

by:bearware
Comment Utility
It seems there is no portable way to do this with SQL.
I friend says that ODBC,JDBS, and UDBC provide a portable way.
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
Comment Utility
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now