moving tables to diff file and filegroup

Last Post 28 Apr 2014 01:38 PM by dbandee. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
dbandee
New Member
New Member

--
22 Apr 2014 06:53 AM
i have a table that i want to move to secondary file-group
so i added new file-group and new file in this new file-group

i moved table successfully so now it lives where i wanted is to be
but my question is:
1. If i were to have two file in this new file-group
is there a way to move the table to a specific file within file-group?

CREATE UNIQUE CLUSTERED INDEX PK_MyPKINDEX ON dbo.VeryLargeTable
(
ItemID ASC
) WITH (DROP_EXISTING = ON)
ON SecondaryFG
GO

the tsql command the i used see me to only specify file-group name and not file

thank you
rm
New Member
New Member

--
23 Apr 2014 06:03 AM
Can't move to specific file in file group, file group is the basic unit you can work with.
gunneyk
New Member
New Member

--
23 Apr 2014 12:53 PM
Yes just to add what rm stated the data is divided up in how ever many files there are in a filegroup based on the amount of free space in each one. This is why it is important to add all the files you want at the beginning to a given filegroup and make them all the same size with the same autogrow setting. That way the data is dispersed evenly amongst the files and you get the best performance.
dbandee
New Member
New Member

--
28 Apr 2014 01:38 PM
thank you this is very helpful
You are not authorized to post a reply.

Acceptable Use Policy