Share via


PRIMARY filegroup is full - SQL Error on Saving

Question

Monday, March 16, 2009 8:14 AM

Hi All,

I am using Vb.net 3.5 and Sql Server 2005

In my application some time an error message throws

SQL Error

Could not allocate space for object 'dbo.OutboxData'.'PK_OutboxData' in database 'vbdotnet' 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.

OK

Then I am doing These Steps :

Change the "Autogrowth" percent to 10% and problem is Solved.

Database Properties --> Files -->Autogrowth --> Filegrowth -->
reduce the amount to 10%

Now, My quetion is that If I am Facing This Problem, Then What Can I do programmintically?
Please Help me.

All replies (3)

Monday, September 14, 2009 12:33 PM ✅Answered | 3 votes

Unplanned growth of the Data or Transaction log can take up space in the disk. Check if the autogrow option for both Data and log are not set * By percent * .

You can see this by selecting Database->properties->Data files tab and Transaction log tab.

Please refer the following links for more information:

http://support.microsoft.com/default.aspx/kb/315512/EN-US/

If some of your tables are growing faster than you thought then if possible archive and purge them if not you may need to add more space to the disk...

To resolve this issue withou a down time you can create new to a different drive by adding new file to PRIMARY FILGROUP

For more information about how to grow and shrink your database and log files, click the following article numbers to view the articles in the Microsoft Knowledge Base:

256650  (http://support.microsoft.com/kb/256650/ ) How to shrink the SQL Server 7.0 transaction log

272318  (http://support.microsoft.com/kb/272318/ ) Shrinking the transaction log in SQL Server 2000 with DBCC SHRINKFILE

317375  (http://support.microsoft.com/kb/317375/ ) A transaction log grows unexpectedly or becomes full on a computer that is running SQL Server

247751  (http://support.microsoft.com/kb/247751/ ) BUG: Database maintenance plan does not shrink the database

305635  (http://support.microsoft.com/kb/305635/ ) A timeout occurs when a database is automatically expanding

Best wishes
Xingwei Hu 

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.


Monday, March 16, 2009 10:32 AM | 1 vote

I think you don't have to do anything... Let SQL Server grows your file when it needs !

If you have set autogrowth, SQL will increase the filesize dynamically, in a transparent way for your application....


Friday, July 20, 2012 6:46 AM

Thanks.

I helped me

How to Shrink Log File of Database:

If Log File is pointing to a drive (E or F or C), which is not having sufficient space to Grow the Log File then you may get Error (While running ETLs or running a SQL Query):

Could not allocate space for object in database 'vbdotnet' 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 auto growth on for existing files in the filegroup.

Step-1

1st check how much space allocated to log File. Select Database àPropertiesàFilesà (File Type: Log, Initial Size in MB, Autogrowth & Path).

Note: Initial Size in MBà Based on your daily load you can decide the Size (100 MB to 500 MB or More). Give Autogrowthà Unrestricted Growth

Step-2

<//strong>If Log File sized increased more & not having space in Drive. You can shrink it & it will release space.

Select DatabaseàRight Clickà TasksàShrinkàFilesà A new windows will OpenàSelect File TypeàLogàClick on “Release Unused Space”àOK

Thanks Shiven:) If Answer is Helpful, Please Vote