If you're using MS SQL server, you can also run the following SQL from Query
Analyzer:

-- get all tables for a db
select left(so.name, 27) as tableName
        ,left(sc.name, 20) as columnName
        ,left(st.name, 10) as dataType
        ,sc.length as dataLength
from     sysobjects so
        ,syscolumns sc
        ,systypes st
where  so.id = sc.id
and      sc.xtype = st.xtype
and      so.xtype = 'U'
order by so.name, sc.name


-- get all stored procedures for a db
SELECT sysobjects.name as name
        ,sysusers.name as PROCEDURE_SCHEMA
FROM     sysobjects
        ,sysusers
WHERE  sysobjects.uid = sysusers.uid 
AND      sysobjects.type = 'P'
ORDER BY name

When I'm developing I use the first one all the time to tell me about the
tables and datatypes and data sizes for the fields, etc... it's very useful,
and a lot faster than messing around with the Enterprise manager. Usually I
just run the top SQL statement when I start working on a db, and copy/paste
everything into a text editor (UltraEdit) so I don't have to keep running
it. Every once in a while I need to adjust the "left()" statements to get a
long name or something, but, all-in-all,  these values work really well.



   Jeff Polaski
   "The cow is of the bovine ilk; 
    One end is moo, the other, milk."
               -- Ogden Nash




-----Original Message-----
From: James Johnson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 4:26 PM
To: CF-Talk
Subject: Get List of tables in a DB


Hi,

Is there a CF function or SQL statement that returns a list of table in
an Access DB?

Thanks

*******************************************
James Johnson
SMB-Studios
Innovative Online Learning for Spirit, Mind and Body
www.smb-studios.com
[EMAIL PROTECTED] 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to