Sybase Question: Download Questions PDF
How to manually drop a table in Sybase?
Answer:
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
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
Download Sybase Interview Questions And Answers
PDF
Previous Question | Next Question |
Why not max out all my columns Sybase? | How Do I Take Advantage of Table Partitioning with bcp in Sybase? |