Moving Nonclustered indexes

  • Can some one please provide me the script to move non-clustered indexes from secondary file to primary file. I moved the indexes to secondary file by creating the filegroup, now I want to use the reverse engineering method to move these indexes back to primary file with clustered data. Please help.

  • Drop them and rebuild them on the primary filegroup. ALTER INDEX and CREATE INDEX have options for specifying the filegroup.

  • Can you please send the scripts? Thanks

  • DROP INDEX dbo.TableName.IxName

    CREATE NONCLUSTERED INDEX IxName ON dbo.TableName (Columns, Names) ON [PRIMARY]

    Please keep in mind that Primary is a reserved keyword so you have to use the brackets around it!

  • Read books online for the parameters for the create index command. You might want to note the fillfactor before you do this.

  • And be sure you know what columns are in the index before you drop it.

  • I need to rebuild the indexes on database level for nonclustered indexes in order to move them to primary file.

  • We understood you the first time.

    Where are you blocking at?

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply