Comments
 
posted on September 30th 2015, at 09:31
by lunarg

You can easily move the table to another filegroup by recreate the clustered index on the table:

CREATE CLUSTERED INDEX CIX_YourTable
ON dbo.YourTable(YourClusteringKeyFields)
WITH DROP_EXISTING
ON [filegroup_name]

If the clustered index is unique:

CREATE UNIQUE CLUSTERED INDEX CIX_YourTable
ON dbo.YourTable(YourClusteringKeyFields)
WITH DROP_EXISTING
ON [filegroup_name]

This creates a new clustered index and drops the old one. Because the new index is created in the other filegroup, the table will have been moved to that filegroup.

Add a new comment
 
Your name:
Your e-mail:
Your comment:
 
Basic BBcode is supported.
Captcha:
Type the letters and numbers as shown.
/get/captcha/1715036790
Not readable? Get another.
 
 
 
 
« May 2024»
SunMonTueWedThuFriSat
   1234
567891011
12131415161718
19202122232425
262728293031
 
Links
 
Quote
« Have you tried turning it off and on again? »
The IT Crowd