How to manually drop a table in Sybase?

Submitted by: Administrator
Occasionally you may find that after issuing a drop table command that the ASE crashed and consequently the table didn't drop entirely. Sure you can't see it but that sucker is still floating around somewhere.

Here's a list of instructions to follow when trying to drop a corrupt table:
1. sp_configure allow, 1
go
reconfigure with override
go


2. Write db_id down.

use db_name
go
select db_id()
go


3. Write down the id of the bad_table:
select id
from sysobjects
where name = bad_table_name
go


4. You will need these index IDs to run dbcc extentzap. Also, remember that if the table has a clustered index you will need to run extentzap on index "0", even though there is no sysindexes entry for that indid.
select indid
from sysindexes
where id = table_id
go
Submitted by: Administrator

Read Online Sybase Job Interview Questions And Answers