Wednesday, March 7, 2012

Move existing table to another file or filegroup

Hi,
is it possible to move existing table to another file or filegroup?
Thanks AlesRe-create the clustered index on that filegroup. If you don't have a cluster
ed index and don't want
to have one, create one on the file group and then drop it.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"ales vojacek" <ales vojacek@.discussions.microsoft.com> wrote in message
news:F6788339-43BB-480E-A164-16E313CD32C6@.microsoft.com...
> Hi,
> is it possible to move existing table to another file or filegroup?
> Thanks Ales|||It moves data from whole table to new file group?
Ales
"Tibor Karaszi" wrote:

> Re-create the clustered index on that filegroup. If you don't have a clust
ered index and don't want
> to have one, create one on the file group and then drop it.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "ales vojacek" <ales vojacek@.discussions.microsoft.com> wrote in message
> news:F6788339-43BB-480E-A164-16E313CD32C6@.microsoft.com...
>
>|||Yes. A clustered index is the same as the table (or, more formally: the leaf
pages of the clustered
index are the data pages).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"ales vojacek" <alesvojacek@.discussions.microsoft.com> wrote in message
news:295FDF4A-623F-42A6-AA3F-0C0623894240@.microsoft.com...[vbcol=seagreen]
> It moves data from whole table to new file group?
> Ales
> "Tibor Karaszi" wrote:
>|||I wrote a script that moves a table to another filegroup, and you can
download it from
http://education.sqlfarms.com/ShowPost.aspx?PostID=59
Note that you can specify whether only data pages, and/or other indexes and
constraints should be moved automatically by the script. It's fairly long,
however it was very well-tested.
Omri Bahat
SQL Farms Solutions
www.sqlfarms.com

No comments:

Post a Comment