SQL Shrink Db files  Failure

Posted on 2007-07-31
Last Modified: 2012-08-13

I've been shrinking my database datafiles for some time now but last night I gt an error ehrn trying to shrink the datafiles from SQL server. Here is the error message, I have no idea how to fix this and have tried in vain so far. Can anyone help ?

Error Message
TITLE: Microsoft SQL Server Management Studio

Shrink failed for DataFile 'WebData_dat'.  (Microsoft.SqlServer.Smo)

For help, click:


An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


A severe error occurred on the current command.  The results, if any, should be discarded.
File ID 1 of database ID 5 cannot be shrunk as it is either being shrunk by another process or is empty. (Microsoft SQL Server, Error: 0)

For help, click:
Question by:edjones1
    LVL 14

    Expert Comment

    Is the file empty?

    Is there another process shrinking the datafile at the same time?

    Author Comment


    The file is not empty and no other processes of that type are running
    LVL 14

    Expert Comment

    Anything useful in SQL log about it?
    LVL 22

    Accepted Solution

    There are a few reasons why shrink might fail. One possibility is that you don't have sufficient transaction log space for the shrink operation. Check your SQL Server error log.

    You should NOT run shrink on a regular basis. Here are two articles that explain why shrinking is almost always a bad idea:


    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Join & Write a Comment

    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
    Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now