Another option would be to make a query to retrieve all of the table names. 
 You could store the resulting list in the app scope.  Then, when you 
dynamically construct the table name for a given month, check to make sure it 
is in the list of tables before running the query to get the month's events.
-David

On Thursday, April 12, 2001 8:32 AM, Peter Stolz [SMTP:[EMAIL PROTECTED]] 
wrote:
> SELECT *
> FROM INFORMATION_SCHEMA.TABLES
> WHERE TABLE_NAME = 'events0301'
>
> HTH,
> P.
>
> -----Original Message-----
> From: Diana Nichols [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 12, 2001 11:07 AM
> To: CF-Talk
> Subject: existence of table
>
>
> Is there a way to check for the existence of a database table (SQL 2000)?
>
> I have a calendar which stores each month's events in a separate table
> (events0301), and if the user hits the "last month" button past where the
> tables start, it throws an error.
>
> I tried a cftry/cfcatch on the query, but....To complicate matters, I'm
> using a UNION on "this" month and "last" month to show any events not
> cleared from the previous month. So, the first table is events0301, and the
> cftry/cfcatch scenario won't let them view events from March because
> February table doesn't exist.
>
> Insights, suggestions?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to