Solved

sql query to get list of all tables

Posted on 2002-04-12
8
1,551 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
ID: 6937303
Try:
Select TABLE_NAME,TABLE_TYPE from INFORMATION_SCHEMA.TABLES
0
 
LVL 3

Expert Comment

by:arun04
ID: 6938477
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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6941439
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:mrorph
ID: 6941778
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
 
LVL 1

Expert Comment

by:Moondancer
ID: 6946629
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
ID: 7014106
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
ID: 7265666

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
ID: 7296563
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mysql Left Join Case 10 101
MySQL Query Using Up Memory 6 51
How to structure query with count aggregate 4 41
Dynamic Table mySQL stored procedure 5 30
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…

679 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