Drops a segment from a database or unmaps a segment from a particular database device.
sp_dropsegment segname, dbname [, device]
is the name of the segment to be dropped.
is the name of the database from which the segment is to be dropped.
is the name of the database device from which the segment segname is to be dropped. This parameter is optional, except when the system segment system, default, or logsegment is being dropped from a database device.
This command drops the segment indexes from the pubs2 database.
sp_dropsegment indexes, pubs2
This command unmaps the segment indexes from the database device dev1:
sp_dropsegment indexes, pubs2, dev1
You can drop a segment if it is not referenced by any table or index in the specified database.
If you do not supply the optional argument device, the segment is dropped from the specified database. If you do supply a device name, the segment is no longer mapped to the named database device, but the segment is not dropped.
Dropping a segment drops all thresholds associated with that segment.
When you unmap a segment from one or more devices, Adaptive Server drops any thresholds that exceed the total space on the segment. When you unmap the logsegment from one or more devices, Adaptive Server recalculates the last-chance threshold.
sp_placeobject changes future space allocations for a table or index from one segment to another, and removes the references from the original segment. After using sp_placeobject, you can drop the original segment name with sp_dropsegment.
For the system segments system, default, and logsegment, you must specify the device name from which you want the segments dropped.
Only the Database Owner or a System Administrator can execute sp_dropsegment.
System procedures sp_addsegment, sp_addthreshold, sp_helpsegment, sp_helpthreshold, sp_placeobject