List all tables in the database

Is there an SQL command that will list all the tables in the database and which is vendor independent (works on MSSQLServer, Oracle, MySQL)?

+5
source share
4 answers

The closest option is to query INFORMATION_SCHEMAfor tables.

SELECT *
FROM INFORMATION_SCHEMA.Tables
WHERE table_schema = 'mydatabase';

INFORMATION_SCHEMAis part of standard SQL, but not all providers support it. As far as I know, the only RDBMS providers that support it are:

, . Oracle, IBM DB2, Firebird, Derby .. "", , . , ANSI SQL INFORMATION_SCHEMA. , , , , .

(: IBM DB2 UDB System IBM DB2 UDB Windows/* NIX - Universal UDB!)

(, SQLite) - .

+15

. -.

+5

, SQL ( ), ( SELECT ) SQL, .

+1

, SQL, ODBC , SQLTables, !

pjjH

API : http://msdn.microsoft.com/en-us/library/ms711831.aspx

+1

All Articles