September 29, 2007 at 9:25 pm
Comments posted to this topic are about the item move all indexes to a secondary file group
MVDBA
August 18, 2008 at 5:43 pm
I really like the script, but it does not maintain the unique portion of indexes which makes it hard to use in some cases.
---
Timothy A Wiseman
SQL Blog: http://timothyawiseman.wordpress.com/
August 30, 2008 at 5:15 pm
Thanks a lot to the author!
One problem with the script: it doesn't recognize indexes with included fields. Does anybody know what system table(s) contain this information? Better yet, is there any kind of API for Management Studio's scripting?
August 31, 2008 at 9:47 am
keppro (8/30/2008)
Thanks a lot to the author!One problem with the script: it doesn't recognize indexes with included fields. Does anybody know what system table(s) contain this information? Better yet, is there any kind of API for Management Studio's scripting?
It is in sys.index_columns, with the included columns marked by a 1 in the is_included column.
---
Timothy A Wiseman
SQL Blog: http://timothyawiseman.wordpress.com/
October 10, 2008 at 2:59 pm
I loved the script. I wish the author or some cold post the reverse process like moving non-clustered indexes from secondary to primary with clustered indexes.
January 7, 2009 at 11:03 am
Got an error about foreign key. Any idea?
Msg 3723, Level 16, State 6, Line 1
An explicit DROP INDEX is not allowed on index 'xxxxxxxxxxxxxx'. It is being used for FOREIGN KEY constraint enforcement.
October 5, 2009 at 9:21 pm
What is the logic behind keeping Non-Clustered with Primary and Clustered with Secondary?
February 8, 2010 at 10:44 am
I've updated this script to do a few additional things, like
- Properly re-create unique indexes
- Handle Included columns
- Do "online" index moves w/error handling - creates new index, drops old, then renames
- Uses existing fill factor if the source index explicitly defines it
I've posted the script at my blog - I'm interested if anybody else has feedback or something they'd like to see added.
http://www.trycatchfinally.net/post/2010/02/08/Migrate-database-indexes-to-a-new-file-group.aspx
Ryan
September 28, 2011 at 3:17 pm
is this link working ?????????
September 28, 2011 at 4:21 pm
I've fixed the redirection on my blog, so you can view it now. I must have changed the layout at some point and not set up this forwarding page properly.
Sorry for the confusion.
Ryan
January 2, 2013 at 7:26 am
Hi,
Can some one provide links to move tables & indexes to other file group without drop & Recreate them.
Just like to move object to other file group without drop and recreate.
Thanks
January 2, 2013 at 9:09 am
To do this, you have to create a clustered index on the table and specify the new file group for the index - once you've moved it, you can drop the index if you don't need it. Effectively, you'd use this same script, but you'd remove the filter that causes it to ignore clustered indexes so that it migrates those as well.
Ryan
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply