Moving Tables to other filegroups

  • Hi

    can anybody please tell me how to move a group of tables to some other filegroup.

    I know using SQL EM to move a single a table.. but how to move group of tables at a time..

     


    Thanks ,

    Shekhar

  • I don't think there is any way to move all tables to different tables at once...

    You can write a script to move clustered index to different file group which will move the table...and run the script at once as a job or in QA...

    CREATE CLUSTERED INDEX mynewfilegroup ON mytable (col1, col2...)

    WITH DROP_EXISTING

    ON filegroupname

    MohammedU
    Microsoft SQL Server MVP

  • Thank you Uddin for the suggestion..


    Thanks ,

    Shekhar

  • - keep in mind that if the clustered index gets dropped, your data will move back to the filegroup defined at "create table"-time.

    - so if you can, create the table in the correct filegroup.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 4 posts - 1 through 3 (of 3 total)

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