Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 892049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:59:20+00:00 2026-05-15T13:59:20+00:00

How can I create a File Group on a different drive with MSSQL 2005

  • 0

How can I create a File Group on a different drive with MSSQL 2005 and then move a table into it?

Ex: my database is on H:\Product.mdf and H:\Product.ldf

I want to create a new file group on F:\FileGroup\ and then move my table with a clustered index to this new file group.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:59:20+00:00Added an answer on May 15, 2026 at 1:59 pm

    This is not a simple task, and depending on the size of your tables may require a chunk of downtime.

    First, you have to define the new file group:

    ALTER DATABASE MyDatabase
     add filegroup NewGroup
    

    Then, create an appropriate file for that file group, for example:

    ALTER DATABASE MyDatabase
     add file
      (
        name = NewFile
       ,filename = 'C:\temp\NewFile.ndf'
       ,size = 100MB
       ,maxsize = unlimited
       ,filegrowth = 100MB
      ) 
     to filegroup NewGroup
    

    To move a table onto the file group, you have to create a clustered index for that table on the file group. If you’ve got a clustered constraint (such as a unique or primary key), you’ll have to drop it first. Here’s one way to move such a table:

    --  Set up sample table
    CREATE TABLE MyTable
     (
       Data varchar(100) not null
       constraint PK_MyTable
        primary key clustered
     )
    
    --  Can't "move" primary key constraint to a new file group
    ALTER TABLE MyTable
     drop constraint PK_MyTable
    
    --  This will move the data in the table to the new file group
    CREATE clustered index Move_MyTable
     on MyTable (Data)
     on NewGroup
    
    --  Still in the new file group, just no index
    DROP INDEX MyTable.Move_MyTable
    
    --  Recreate the primary key, keeping it on the new file group
    ALTER TABLE MyTable
     add constraint PK_MyTable
      primary key clustered (Data)
      on NewGroup
    

    It is just a bit fussy, so be sure to test everything on copies of your databases first!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to display a group (file extension and icon)(parent) then all of the
Say I have the following XML file: <?xml version=1.0 encoding=utf-8?> <venues> <group type=Nearby> <venue>
I am using flex4, I am seeking the answer to create multi window web
I have a report in Access that we want split and exported to .rtf
I have the below Delphi code to provide a friendly wrapper for the CreateProcess
I guess this question is directed at Linux/Unix system programming experts (unfortunately I am
I'm searching for a multiuser web-based calendar system that supports multiple users. I'm looking
Hey guys and girls, i'm stumped. Trying to get array_search to work with this
I am not sure if I am asking the right question. But is it
I read that threads share the memory address space of it's parent thread. If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.