Too bad you aren't checking whether your actions succeed,
and neither are you using transactions when you are modifying
your database. Now your examples are equivalent of Perl code
that isn't strict, doesn't have warnings turned on, and isn't
checking the return values of system calls.

Pity.

There's no execuse to not wrap your database modifying
statements inside a transaction, and to not rollback on
failure.

As for checking for the existance of a table, that's
rather easy in Sybase and MSSQL:

SELECT 1
FROM sysobjects
WHERE name = "whatever" -- Name of the table
AND type = "U" -- User defined table.
-- Use "S" for a system table.