> 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.

I'm assuming that SQL 2k works the same as SQL 7 this way

Select table_name
from information_schema.tables
where table_name='myTable'

If it has a record, then it exists...

I'd suggest checking all table_names and then building the SQL in a string
before running it, that'll stop the errors

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



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

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to