Learn about EXISTS ( you need to know it so you can do an update/insert statement in the same pass anyway )
On MSSQL/Sybase I would do something like:
in reply to Checking for DB table existence using DBI/DBD
You need to consult the docs as to how your database implements EXISTS which normally operates on a subquery and returns a boolean.
IF EXISTS ( SELECT 1 FROM sysobjects where name = 'some_table' and typ
+e = 'U' )
-- do this if true ( maybe an update here )
-- do this if false ( maybe an insert here )