You should always query the sys tables with caution as there is no guarantee
that the schema for these tables will stay the same in future releases of
SQL Server.



   _____  

From: Bill Grover [mailto:[EMAIL PROTECTED]
Sent: 08 July 2004 13:25
To: CF-Talk
Subject: RE: Find out table names and fields?

If you have an ODBC connection, or can make one, according to Microsoft's
website there are catalog functions built into ODBC that returns database
information.  Here is the link to the info in MSDN:

http://msdn.microsoft.com/library/default.asp?url=""> bccatalog_functions_in_odbc.asp

Might or might not help!
______________________________________________________
  <file:///E:/EUColor.gif>
Bill Grover
Manager, Information Systems Phone: 301.424.3300 x3324
EU Services, Inc. FAX: 301.424.3696
649 North Horners Lane E-Mail:   <mailto:[EMAIL PROTECTED]>
[EMAIL PROTECTED]
Rockville, MD 20850-1299 WWW:   <http://www.euservices.com/>
http://www.euservices.com
______________________________________________________

-----Original Message-----
From: Stephen Milligan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 07, 2004 5:25 PM
To: CF-Talk
Subject: RE: Find out table names and fields?

You can also dig down to the java level and do this in a database
independent way through the macromedia.jdbc.MacromediaDriver class if you
need to support more than just MSSQL and MySQL.

I have written a CFC that does this, but I haven't tested it on many
systems.

I'll try to get it tidied up and make it available once it's been tested a
bit more thoroughly.

Spike

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org

>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of S.Isaac Dealey
>Sent: Wednesday, July 07, 2004 1:13 PM
>To: CF-Talk
>Subject: Re: Find out table names and fields?
>
>Those are specific to MySQL - MS SQL uses standard tables, views and
>sql queries to expose its meta data. i.e.
>
>select * from information_schema.columns
>where table_name = 'mytablename'
>
>and the like
>
>s. isaac dealey   214.823.9345
>
>new epoch : isn't it time for a change?
>
>add features without fixtures with
>the onTap open source framework
>http://www.sys-con.com/story/?storyid=44477&DE=1
>
>> how do i dump the results to display on the page?  Will
>> this only work for mySQL, or for MS SQL as well?
>
>> thanks!
>>   ----- Original Message -----
>>   From: Barney Boisvert
>>   To: CF-Talk
>>   Sent: Wednesday, July 07, 2004 3:42 PM
>>   Subject: RE: Find out table names and fields?
>
>
>>   Sure, run these queries, and dump the result.
>
>>   `show databases` will list all databases you have access
>>   to via the DSN.
>>   `show tables` will list all tables in the database the
>>   DSN is connected to.
>>   `show tables in <dbname>` will list all tables in the
>>   named database.
>>   `explain <tablename>` will list the columns of the named
>>   table.  You can use
>>   cross-database tables by saying <dbname>.<tablename>
>
>>   Cheers,
>>   barneyb
>
>>   > -----Original Message-----
>>   > From: brobborb [mailto:[EMAIL PROTECTED]
>>   > Sent: Wednesday, July 07, 2004 1:26 PM
>>   > To: CF-Talk
>>   > Subject: Find out table names and fields?
>>   >
>>   > Hey guys, I have a host that has no web admin support
>>   > for
>>   > mySQL.  I mean, they have MySQL running, but no admin.
>>   > At
>>   > least thats what I'm told by my client. I was
>>   > wondering if
>>   > there was a way to extract the table names and fields
>>   > using
>>   > coldfusion instead.  Would that be possible?
>>   >
>>   >
>
>
>>
>
>
  _____

   _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to