How do I map tables in new schemas to new filegroups ?

  • I have three new schemas in a db and have 25 or so tables in each of those schemas. Now I want to get the existing tables in each schema that are presently in the PRIMARY filegroup to a separate new filegroup for each schema. I would appreciate your comments on how to accomplish that.

  • You need to rebuild the clustered indexes onto the new filegroup.

    CREATE INDEX ... WITH DROP_EXISTING specifying ON [NewFileGroup] should work. I seem to recall it works even if the index is part of a primary key, but I'm not totally sure.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 2 (of 2 total)

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