In MS SQL Server (2000), you can use the system stored procedure sp_tables.


Issuing the command:


exec sp_tables


will list all the tables in the current database, with a column for table type (System or Table).  More details are in the online help for T-SQL.


There are similar stored procs for getting the primary keys, foriegn keys, and lists of databases.  I also know database systems other than MS SQL have similar functions for getting the meta data of a database.


HTH


Shawn

-----Original Message-----
From: Robert Shaw [mailto:[EMAIL PROTECTED]
Sent: Friday, June 04, 2004 9:48 AM
To: CF-Talk
Subject: Get Database Tables, etc

I know I have seen this on the list before but I can't find the exact code.
Does anyone have the code for querying a database and returning a list of
tables and/or column info?

TIA,
Robbie
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to