Drops a segment from a database or unmaps a segment from a database device.
sp_dropsegment segname [, logical_name]
where
You cannot drop a segment if it is being referenced by any table or index in the current database.
If you do not supply a logical_name, the segment is dropped from the current database. If you supply a logical_name, the segment is dropped only from the named database device; it remains mapped to any previously specified devices and the segment remains in the database.
Using the sp_placeobject system stored procedure to change future space allocations for a table or an index from one segment to another removes the reference to the original segment. You can drop the original segment name with sp_dropsegment.
For the SYSTEM, DEFAULT, and LOGSEGMENT system segments, specify the device name from which you want the segments dropped.
This example drops the segment INDEXES from the current database.
sp_dropsegment INDEXES
This example unmaps the segment INDEXES from the database device DEV1.
sp_dropsegment INDEXES, DEV1
Execute permission defaults to the database owner.
sysindexes, syssegments, master.dbo.sysdevices, master.dbo.sysusages
sp_addsegment | sp_placeobject |
sp_helpsegment |