MSSQLTips.com - your daily source for SQL Server tips

Google
 
Web mssqltips.com

ESSENTIALS: Home | Tips | Search | Categories | Top 10 | Products | Authors | Blogs | Forums | Webcasts | Advertise | About
Guidance on splitting into multiple FILEGROUPs -

in Search

Guidance on splitting into multiple FILEGROUPs

Last post 11-30-2007 12:42 PM by admin. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-29-2007 11:16 AM

    • SAinCA
    • Top 25 Contributor
    • Joined on 11-29-2007
    • Posts 7

    Guidance on splitting into multiple FILEGROUPs

    I have a SS2K environment, moving to SS2K5 (or even direct to SS2K8 next year) and would like to start splitting tables into discrete FILEGROUPs.  Is there a publication or Tip that addresses how to do this.  It would need to be 6th-grade level becasue we have NO real DBA and I know enough to keep things up and running but am a long time Database Developer.  URL's would be great...  Thanks!

  • 11-29-2007 6:52 PM In reply to

    Re: Guidance on splitting into multiple FILEGROUPs

    SAinCA,

    Thank you for the question.  It is a valid one and a new technique in SQL Server that can reap numerous benefits. 

    Here are 2 tips with information on SQL Server 2005 filegroups:

    Please take a look at these and let us know if they answer your questions.  If not, please post your questions and we will respond ASAP.

    I am sure many of the questions you have are similar to those from other people in the community.

    Thank you,
    The MSSQLTips.com Team

  • 11-29-2007 7:03 PM In reply to

    • SAinCA
    • Top 25 Contributor
    • Joined on 11-29-2007
    • Posts 7

    Re: Guidance on splitting into multiple FILEGROUPs

    Thanks for the pointer to Tip 1112, which helps somewhat, but I'm unclear about what to do in my case:

    • Nearly all tables have a clustered PK CONSTRAINT, and we use the simple naming standard pk_%tablename% for these.
    • According to the 1112 "Move" examples, I must create a different CLUSTERED Index - no mention of CONSTRAINT issues...

    What do I do in this situation?

    Thanks again.

  • 11-30-2007 12:42 PM In reply to

    Re: Guidance on splitting into multiple FILEGROUPs

    SAinCA,

    I think this is the code you are referencing from this tip (http://www.mssqltips.com/tip.asp?tip=1112):

    -- Table - The base table is stored with the
    -- clustered index, so moving the clustered
    -- index moves the base table
    CREATE CLUSTERED INDEX IDX_ProductID ON dbo.OrdersDetail(ProductID)
    ON FG_ReadOnly
    GO

    If so, you can use the ALTER TABLE command to create or remove the primary keys.  Here is an example from SQL Server 2005 Books Online (http://msdn2.microsoft.com/en-us/library/ms190273.aspx):

    USE AdventureWorks;
    GO
    ALTER TABLE Production.TransactionHistoryArchive WITH NOCHECK
    ADD CONSTRAINT PK_TransactionHistoryArchive_TransactionID PRIMARY KEY CLUSTERED (TransactionID)
    WITH (FILLFACTOR = 75, ONLINE = ON, PAD_INDEX = ON)
    GO

    If this is not the code you are referencing, please reply back with the code from the tip that you have a question about.

    Thank you,
    The MSSQLTips.com Team

     

Page 1 of 1 (4 items)