Add space to default PRIMARY filegroup

  • Is there a way to add space to the existing, default PRIMARY filegroup for a given DB? (some sample ALTER DDL would be great if anybody has any)

    My Insert data Job failed with this error:

    Could not allocate space for object dbo.MyTable'.'PK__MyTable' in database 'MyDatabase' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup. [SQLSTATE 42000] (Error 1105).

    Recently added 200 GB on a seperate drive and I successfully created a NEW filegroup for MyDatabase and Altered MyDatabase and added additional files (.ndf's) --- my concern is that existing objects (including the PK above) are defined to use the default PRIMARY filegroup which is out of space.

    BT
  • You could add additional data files to the Primary filegroup such as:

    ALTER DATABASE [mydatabase] ADD FILE

    ( NAME = N'mydatabase2', FILENAME = N'C:\mydatabase2.ndf' ,

    SIZE = 102400KB , FILEGROWTH = 102400KB )

    TO FILEGROUP [PRIMARY]

    or you could move the clustered indexes of tables to your newly created filegroup.

  • I suggest that you move some of the tables to the new filegroup.

    Here is an article that explains that:http://www.sqlservercentral.com/articles/Files+and+Filegroups/65538/

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Is the file set to autogrow? Is it full because the drive is full?

    ---------------------------------------------------------------------

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

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