Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1569
  • Last Modified:

sql query to get list of all tables

Any one know how to list all tables in a db using SQL
0
bearware
Asked:
bearware
1 Solution
 
mrorphCommented:
Try:
Select TABLE_NAME,TABLE_TYPE from INFORMATION_SCHEMA.TABLES
0
 
arun04Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
mrorphCommented:
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
 
MoondancerCommented:
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
 
bearwareAuthor Commented:
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
 
nico5038Commented:

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

Netminder
CS Moderator
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now