Skip to Content
0
Aug 15, 2016 at 09:17 AM

move objects back to the 'default' segment

78 Views

Hi There,

have found the code below on the net, but when i use sp_placeobject 'default', object, the index is automatically moved to the default segment.

I can drop the other (old) segment without any problems.

Is this correct? Is the code and comments below, obsolete?

<code>

/* move a table, in its entirety, to the new segment */

drop index 'employee.idx_employee'

go

create clustered index on employee (emp_id) on new_seg

go

/* leave table where it is, but future allocations go to the new segment */

sp_placeobject new_seg , 'employee'

go

/* leave table where it is, but future allocations for the

text column (employee_notes) go to the new segment */

sp_placeobject new_seg , 'employee.temployee'

go

/* leave table where it is, but future allocations for the

text column (resume) go to the new segment */

sp_placeobject new_seg , 'student.tstudent'

go

</code>



Regards,


Harry