Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL can't delete rows from a table - Coulud not allocate space

$
0
0

I'm trying to delete 30 percent of rows from a table. Database is at maximum. This table is using 5GB of my data and i want to delete half of it at least. I tried running with 1 percent, same result.

I run the following

DELETE TOP (30) PERCENT
FROM [database1].[dbo].[tablenamegoeshere]

SQL
DELETETOP(30)PERCENTFROM[database1].[dbo].[tablenamegoeshere]

I get the following error

Msg 1105, Level 17, State 2, Line 1
Could not allocate space for object 'dbo.tablenamegoeshere.'tablenamegoeshere_randomnr_DF98CDFD5E3FF0B0' in database 'database1' 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.

Any workaround ?

If i truncate the whole table then my program doesn't work....


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>