For sqlServer, you can also use the spTables and spColumns procedures

For mySQL and others, the SHOW command is the answer (SHOW TABLES and SHOW COLUMNS)

Jerry Johnson

>>> [EMAIL PROTECTED] 06/26/03 04:22PM >>>
Thats just for sql server (maybe access too)

WG

-----Original Message-----
From: Fetter, Brad [mailto:[EMAIL PROTECTED] 
Sent: 26 June 2003 20:59
To: CF-Talk
Subject: RE: how to get the tablenames in a database


I think I can answer this one....

here is an example of getting tables names dynamically from a database....

Hope this helps,
Brad Fetter
[EMAIL PROTECTED] 
FLIR Systems, Inc.

<cfquery name="datalist" datasource="Portdw">
SELECT sysobjects.Name as Tablename,
 Syscolumns.Name as Fieldname
from sysobjects,
 Syscolumns
Where Sysobjects.Name = 'CAR'
and sysobjects.ID = Syscolumns.ID
Order by sysobjects.Name</cfquery>

</body>
<cfoutput query="datalist">
#fieldname#<BR>

</cfoutput>

-----Original Message-----
From: Bosky, Dave [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 26, 2003 12:52 PM
To: CF-Talk
Subject: how to get the tablenames in a database


I have a DSN. From this i can easily get the name if database it is pointing
to.
But how to get the tables in that database at run time?


Thanks,
Dave



HTC Disclaimer:  The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of this
message is not the intended recipient, or an employee or agent responsible
for delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error, please notify us immediately by replying to the
message and deleting it from your computer.  Thank you.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

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

Reply via email to