How to get information about tables and table columns in Oracle and SQL-Server?

by Manuel 12/13/2007 9:44:00 AM

Oracle

Get all tables including the system ones:
SELECT table_name FROM all_tables;

That will give you only the tables owned by the user that you are connecting as:
SELECT table_name FROM user_tables;

Query table columns:
SELECT * FROM all_tab_cols WHERE table_name = 'whatever table name you are looking for'

Looking for comments on the tables:
SELECT * FROM all_tab_comments WHERE table_name = 'whatever table name you are looking for'

SQL-Server

That will give you all tables:
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Oracle | SQL-Server

Related posts

Comments

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012

Sign in