Ryan,

Depending on how often you run update stats on the SQL
database you might be able to use this.

This will loop through all databases on sysdatabases
and then get all the tables in the database and
finally list all of the columns in the order they
should be.


DECLARE @ls_db varchar(255),
        @ls_sql varchar(255)

SELECT @ls_db = null

SELECT @ls_db = Min(name)
FROM master.dbo.sysdatabases

WHILE @ls_db is not null
BEGIN

        SELECT @ls_db
        SELECT @ls_sql = 'select O.name, C.name from ' +
@ls_db + '.dbo.sysobjects O join syscolumns C ON C.id
= O.id where O.xtype = "U" order by O.name,
C.colorder'

        EXEC ( @ls_sql)


        SELECT @ls_db = Min(name)
        FROM master.dbo.sysdatabases
        WHERE name > @ls_db
END

Again, good luck!!!

Chris
--- Ryan Hartwich <[EMAIL PROTECTED]>
wrote:
> Chris,
> 
> Your SQL code to do a table lookup and extract the
> column names works on SQL
> 7 also.  Thanks a lot!  Any permutations to do
> output all the table names in
> a database/datasource?
> 
> Ryan
> 
> 
>  
>  
>
______________________________________________________________________
> The KCFusion.org list and website is hosted by
> Humankind Systems, Inc.
> List Archives........
> http://www.mail-archive.com/cf-list@kcfusion.org
> Questions, Comments or Glowing Praise..
> mailto:[EMAIL PROTECTED]
> To Subscribe....................
> mailto:[EMAIL PROTECTED]
> To Unsubscribe................
> mailto:[EMAIL PROTECTED]
>  


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
 
 
______________________________________________________________________
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives........ http://www.mail-archive.com/cf-list@kcfusion.org
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe.................... mailto:[EMAIL PROTECTED]
To Unsubscribe................ mailto:[EMAIL PROTECTED]
 

Reply via email to