Data Move in FileGroup

  • Is there any quick way of moving data from one filegroup to the other. I dont want to rebuilt the create table and create index script but just findinga  way to create a new filegroupa nd move entire data form one to the other. any help will be greatly appreciated.

    TIA

  • (Re)Create the clustered index on the new filegroup and specify WITH DROP_EXISTING. That will move the table. In case of indexes you'll need to drop and recreate manually, AFAIK.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • I believe Frank is right. If you have stored procedures and other objects, I think they have to be dropped and recreated on a new filegroup to move them as well.

  • If you don't want to have to re-script and your maintenance slot allows, you could do via Ent Mgr.  Right click on table, select design, select the 'manage relationships' icon and then the table and/or indexes tab.  You can switch filegroups there.  Quick and easy if you haven't many tables or there not large. It clearly needs to do an underlying re-build though so be careful as large objects will take time

  • I would actually like to advocate that you never use EM for any kind of write operations, especially not as sensitive as shuffling data around. Main reason for this is simply that you lack control over what EM does, and in some cases interrupted work may stay that way - interrupted and unusable.

    However, you may very well use EM to generate the scripts that EM itself uses on your behalf. The only difference is that you don't let EM execute the operation, instead you save the script. This also lets you review what EM intended to do with your request, and you can verify that your intentions was indeed those. After you have reviewed the EM-generated scripts, you should run it in QA. This will give you total control over any transactions performed.

    ..just my .02 anyway

    /Kenneth

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

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