Extends the range of a segment to another database device.
sp_extendsegment segname, logical_name
where
Once a segment has been defined, you can put a table or index on it by using the CREATE TABLE and CREATE INDEX statements. If a table or index is created on a particular segment, all subsequent data for that table or index will be located on that segment.
To associate a segment with a database device, the database must have been created or altered with a reference to that device. A database device can have more than one segment associated with it, and a segment can be extended over several database devices.
Extending the log segment to a new device unmaps any existing segments from that device.
Because sp_addsegment and sp_extendsegment do not accept a size parameter, when a segment is created it is mapped to the entire amount of space allocated for the specified database on the specified device. When the database is expanded with ALTER DATABASE, any segments mapped to that device for the database are expanded to all allocated space.
This example extends the range of the segment INDEXES to the database device DEV2.
sp_extendsegment INDEXES, DEV2
Execute permission defaults to the database owner.
syssegments, master.dbo.sysdevices, master.dbo.sysusages
ALTER DATABASE | sp_helpdb |
CREATE INDEX | sp_helpdevice |
CREATE TABLE | sp_helpsegment |
sp_addsegment | sp_placeobject |
sp_dropsegment |