SELECT table_name
FROM INFORMATION_SCHEMA.COLUMNS
WHERE column_name = 'htmlemail'
That should do it
On Sun, 13 Jun 2004 00:52:49 +1000, Michael Kear wrote:
>
> I want to dynamically include tables in a query, to perform an operation on
> a table only if it contains a column called "htmlemail". How can I query
> the database and determine if a table has such a column?
>
> I have worked out I can get a list of the tables using SELECT name FROM
> sysobjects WHERE Xtype='u' Is there a similar way I can loop through the
> list of tables and determine if it includes the column "htmlemail"?
>
> Oh yea, I'm using CFMX6.1 and the database is MS SQL2000, just in case it
> makes any difference.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

