In MS SQL server there is a system table called "sysobjects" for each
database. This contains an entry for each table in that database.

To get a list of all the user tables (the tables you built) you would
use a query like this.

SELECT *
FROM sysobjects
WHERE xtype = 'u'

Once you have a list of the tables you can loop over the names of the
tables and get a list of the columns in a table by doing

SELECT *
FROM <the table>

<cfset listOfColumns = queryname.columnlist>

I know its sloppy (but you get the idea im sure) but wanted to respond
real quick before I ran off to a meeting. 

Hope this helps

-chris.alvarado
[ application developer ]
4 Guys Interactive, Inc.
http://www.4guys.com
phone: 281.807.4344 x1716
fax: 281.807.4384

"We create websites that make you a hero."



-----Original Message-----
From: Rebecca Joy Sherman [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 04, 2003 2:07 PM
To: CF-Talk
Subject: GET TABLES IN DATASOURCE / GET FIELDS IN TABLE


Help!  I need to get the tables in a datasource and then the fields in a
table.
Basically I would love to have something like Nates Two-select box with 
tables and fields.
Can you please help?


Joy ;-*



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to