Re: SOT: Any way to get table names and datatypes via a query?

2006-10-22 Thread Pete Ruckelshaus
Nice, Steve, thanks! This will save me a lot of time. Pete ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a yea

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-22 Thread Dan Plesse
I always got this kind of information via the connection object and metaData() function and Claude has always offered that ODBC product. From the DSN use getConnection().getMetaData() I think. On 10/22/06, Pete Ruckelshaus <[EMAIL PROTECTED]> wrote: > > Nice, Steve, thanks! This will save me a l

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-22 Thread Claude Schneegans
>>Using SQL Server 2000, is there any way to get (a) a list of non-system table names for a given database, and (b) any way to get the datatypes for database columns? This would be via two different queries. Although it is possible to get these information from SQL Server, you may find it simple

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-22 Thread Steve Bryant
Pete, I actually have a free tool (DataMgr) that does this (among other things). http://www.bryantwebconsulting.com/presentations.cfm http://www.bryantwebconsulting.com/cfcs/ Call the getDatabaseTables() method to get the non-system tables. Call the getDBTableStruct(tablename) to get information

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-22 Thread Robertson-Ravo, Neil (RX)
edexpo.com -Original Message- From: C. Hatton Humphrey To: CF-Talk Sent: Sun Oct 22 13:36:33 2006 Subject: Re: SOT: Any way to get table names and datatypes via a query? On 10/22/06, Robertson-Ravo, Neil (RX) <[EMAIL PROTECTED]> wrote: > The problem is I would assume the dimore ex

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-22 Thread C. Hatton Humphrey
On 10/22/06, Robertson-Ravo, Neil (RX) <[EMAIL PROTECTED]> wrote: > The problem is I would assume the dimore expects you are an sa login? Actually it's not based on login at the execution of the script, simply at the datasource level. Whatever the DSN can see, the script will dump... tables, SP's

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-22 Thread Robertson-Ravo, Neil (RX)
. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -Original Message- From: C. Hatton Humphrey To: CF-Talk Sent: Sun Oct 22 02:49:25 2006 Subject: Re: SOT: Any way to get table nam

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-21 Thread Pete Ruckelshaus
OK, since all I needed for what I'm planning is the table names, column names, datatypes, and column length (primarily for varchar fields), here's the query I came up with (based upon Hatton's work): SELECT SO.Name as TableName, SC.Name as ColumnName,

RE: SOT: Any way to get table names and datatypes via a query?

2006-10-21 Thread Dave Francis
lectedTableName#' ORDER BY column_name -Original Message- From: Pete Ruckelshaus [mailto:[EMAIL PROTECTED] Sent: Saturday, October 21, 2006 9:11 PM To: CF-Talk Subject: Re: SOT: Any way to get table names and datatypes via a query? That's awesome Hatton, thanks.

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-21 Thread C. Hatton Humphrey
On 10/21/06, Pete Ruckelshaus <[EMAIL PROTECTED]> wrote: > That's awesome Hatton, thanks. I'll look in BOL to see if I can > figure a better way to find the datatypes, since only varchar and int > IDENTITY seem to be set in your script. That was the initial query that I wrote for the dumper... I

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-21 Thread Pete Ruckelshaus
That's awesome Hatton, thanks. I'll look in BOL to see if I can figure a better way to find the datatypes, since only varchar and int IDENTITY seem to be set in your script. Thanks again, Pete ~| Introducing the Fusion Authorit

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-21 Thread C. Hatton Humphrey
I've built something similar that lets me create a SQL Script dump file similar to what MySQL allows. Here's the "starting idea" for the query - SELECT SO.Name as TableName, SC.Name as ColumnName, ST.Name + CASE WHEN ST.Status = 2 THEN '(' + CONVERT(VarChar(6), SC.Length) + ')' ELSE CASE WHEN SC.

Re: SOT: Any way to get table names and datatypes via a query?

2006-10-21 Thread Andrew Scott
yes from the system tables cant think of the exact query off the top of my head. On 10/22/06, Pete Ruckelshaus <[EMAIL PROTECTED]> wrote: > > Slightly Off-Topic SQL question: > > Using SQL Server 2000, is there any way to get (a) a list of > non-system table names for a given database, and (b) a

SOT: Any way to get table names and datatypes via a query?

2006-10-21 Thread Pete Ruckelshaus
Slightly Off-Topic SQL question: Using SQL Server 2000, is there any way to get (a) a list of non-system table names for a given database, and (b) any way to get the datatypes for database columns? This would be via two different queries. I want to create a CF-based utility that I can "point" at