Adding Segments

Segments are created after devices and databases. You create a segment and place it on a database device. The database you are creating the segment for must have access to the device where you are placing the segment. In other words, you must have either created or altered the database on the device on which you are creating the segment for the database to use that segment.

To use sp_addsegment, you must be in the database that you are creating the segment for.

    To add a segment

sp_addsegment segname, logical_name

where

segname
Is the name of the segment. A segment name must follow the rules for identifiers (for example, FASTSEG2).
logical_name
Specifies the database device where segname will be located.

For example, to create the SEG_MYDISK1 segment on the MYDISK1 database device, type:

sp_addsegment seg_mydisk1, mydisk1

For more information about sp_addsegment, see the Microsoft SQL Server Transact-SQL Reference.