Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database
  3. SQL Server Filegroups

SQL Server Filegroups

Scheduled Pinned Locked Moved Database
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Des McHugh
    wrote on last edited by
    #1

    Hi, I am trying to set up my database with the table storage and the index storage in seperate filegroups. To do this I am trying the following SQL : CREATE TABLE ClosingArea ( ClosingArea_ID INTEGER NOT NULL, ClosingArea_Name VARCHAR(64) ) ON MM32TABLES; ALTER TABLE ClosingArea ADD CONSTRAINT CLOSINGAREA_PK PRIMARY KEY (ClosingArea_ID) ON MM32INDEXES; However this initially creates the table in the MM32TABLES filegroup but the "ALTER TABLE" statement changes the table storage to MM32INDEXES when I obviously only want to store the index in that filegroup. Any ideas why this is happening or how I can do what I want ? thanks in advance.

    J 1 Reply Last reply
    0
    • D Des McHugh

      Hi, I am trying to set up my database with the table storage and the index storage in seperate filegroups. To do this I am trying the following SQL : CREATE TABLE ClosingArea ( ClosingArea_ID INTEGER NOT NULL, ClosingArea_Name VARCHAR(64) ) ON MM32TABLES; ALTER TABLE ClosingArea ADD CONSTRAINT CLOSINGAREA_PK PRIMARY KEY (ClosingArea_ID) ON MM32INDEXES; However this initially creates the table in the MM32TABLES filegroup but the "ALTER TABLE" statement changes the table storage to MM32INDEXES when I obviously only want to store the index in that filegroup. Any ideas why this is happening or how I can do what I want ? thanks in advance.

      J Offline
      J Offline
      Jason Cono
      wrote on last edited by
      #2

      This is because the table and primary key (or clustered index) have to be on the same filegroup. You can create a table on the MM32TABLES group and then create a non-clustered index on MM32INDEXES. Jason Cono, MCSD

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups