SQL: Move Tables between FileGroups
Author: jason
Date: 2014-01-28 09:14:26
Category: Musing

Here is a very good article and stored procedure on moving tables between file groups inside SQL.

Author: Roberto Stefanetti
Link: http://gallery.technet.microsoft.com/scriptcenter/c1da9334-2885-468c-a374-775da60f256f

The Stored Procedure can be found in the above link. It needs to be created in your database. Read the above link for more info!

Code

exec dbo._SP_MOVE_TABLES
@SourceFileGroupID = 1,
@TargetFileGroupID = 2,
@TableToMove = '[AvailableOverageMinutes]',
@MovePKAndAllUniqueConstraints = 1,
@MoveAllNonClusteredIndexes = 1




jason @ jasonthomasfrance.com - www.masterstationlog.com - copyright 2009