Sybase doesn't require you to jump through hoops and "catch" the error code. Seems kludgy. In T-SQL, you can do something like this:
Code:
if exists( SELECT *
FROM sysobjects
WHERE ID = object_id( 'table_name' ) )
DROP TABLE table_name
I think the object_id is indexed in sysobjects whereas the name is not, although I may be wrong (runs off to check the sp_help sysobjects output

).
Ok, I see there's (at least in 12.5) an index upon id and a composite index upon name, uid. So either query will work fine.
edit: I see you found the answer in MS SQL Forums as well.