If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Database's structure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-04-09, 14:34
gkenney gkenney is offline
Registered User
 
Join Date: Dec 2009
Posts: 1
Database's structure

How does one find out, using sql commands, a database's tables, and columns names. I have a database that I would like to run reports on, but I do not know the names of tables, nor the column names in the tables. I tried show table with no result. This is a sql database. Thanks, gkenney.
Reply With Quote
  #2 (permalink)  
Old 12-04-09, 14:39
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
Depends on how you're hitting the database. ADODB has a catalog collection that can provide this for you. If you're hitting the database directly in MSSQL, you can also avail yourself of the INFORMATION_SCHEMA objects, for which there is excellent documentation in BOL/MSDN.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***

Last edited by Teddy; 12-04-09 at 14:43.
Reply With Quote
  #3 (permalink)  
Old 12-07-09, 04:14
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
what type of database is this
virtually every SQL db has the capability to find the objects in its db. you 'just' need to know where to look

in an Access/JET db its msysobjects
in MySQL, and SQL Server (and no doubt Sybase) its information_schema
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #4 (permalink)  
Old 01-04-10, 12:27
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
PostgreSQL also supports the information schema.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Last edited by loquin; 01-04-10 at 12:34.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On