Reputation: 7107
I have set up a database in SQL and I am running a program which downloads and populates the database. This was working for me when I first set up the database but it now does not work. The error I get is the following:
Could not allocate a new page for database 'FDSLoaderDB' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
I have looked online on how to resolve this issue but non of the suggested solutions work. I have tried to update the file sizes in the figure below.
I did this by running the following code:
USE FDSLoaderDB
Go
SELECT growth*8 as filegrowth_KB FROM sys.database_files Where name = N'FDSLoaderDB_log'
Go
USE master
Go
ALTER DATABASE FDSLoaderDB MODIFY FILE (NAME = N'FDSLoaderDB_log', FILEGROWTH = 5GB, MAXSIZE = UNLIMITED) -- adjust size here
Go
USE FDSLoaderDB
Go
SELECT growth*8 as filegrowth_KB FROM sys.database_files Where name = N'FDSLoaderDB_log'
Go
USE FDSLoaderDB
Go
SELECT growth*8 as filegrowth_KB FROM sys.database_files Where name = N'FDSLoaderDB'
Go
USE master
Go
ALTER DATABASE FDSLoaderDB MODIFY FILE (NAME = N'FDSLoaderDB', FILEGROWTH = 5GB, MAXSIZE = UNLIMITED) -- adjust size here
Go
USE FDSLoaderDB
Go
SELECT growth*8 as filegrowth_KB FROM sys.database_files Where name = N'FDSLoaderDB'
Go
USE master;
Go
ALTER DATABASE tempdb
MODIFY FILE (NAME = N'tempdev', SIZE = 60GB, FILEGROWTH = 5GB, MAXSIZE = UNLIMITED)
USE master;
Go
ALTER DATABASE tempdb
MODIFY FILE (NAME = N'templog', SIZE = 20GB, FILEGROWTH = 5GB, MAXSIZE = UNLIMITED);
Go
I re-run the program to re-populate the data and I get the same errors.
The log file of the program populating the database is in the following link.
EDIT:
Upvotes: 0
Views: 497
Reputation: 5217
My congratulations. Seems your database is bigger than 10GB and you use SQL Server express Edition which has limit 10 GB per database https://learn.microsoft.com/en-us/sql/sql-server/editions-and-components-of-sql-server-2017?view=sql-server-ver15
Upvotes: 1