0X00001ABA

Savepoint Fails with Open Files (0X00001ABA)

This error pops up when you try to save a savepoint but there's still open file handles in that transaction. The fix is usually closing those files first.

Cause #1: You Left File Handles Open in the Transaction

This is the most common cause. The error code 0X00001ABA means the transaction still has open file handles. It doesn't matter if you think you closed them — SQL Server or your app didn't do it properly. The savepoint operation requires zero open files on that transaction.

I see this a lot with old-school apps that use CREATE TABLE AS SELECT or bulk insert operations inside a transaction. They open a file, write data, but never call CLOSE or DISABLE on the handle. Then when you try to roll back to a savepoint, bang — error.

How to Fix It

First, identify which files are open. Use Sysinternals Handle tool or sp_who2 to find the session ID. Then run this in SQL Server Management Studio:

-- Find open files for your session
SELECT * FROM sys.dm_tran_locks
WHERE request_session_id = @@SPID
AND resource_type = 'FILE'

If you see file locks, you need to close them. The safest way is to commit the transaction first, then retry your savepoint operation. Don't bother with KILL — that just kills the session and rolls everything back, which defeats the purpose.

For apps, review the code. Any file i/o inside the transaction must be paired with a proper close. I usually wrap the file operations in a TRY...CATCH block to ensure handles get released even if something goes wrong.

Cause #2: The Transaction Is Too Long

Long-running transactions love to keep file locks open. If you started the transaction hours ago and still have open files, SQL Server won't let you create a savepoint. This isn't a bug — it's by design. The engine can't snapshot file states reliably.

I've seen this happen in ETL processes that open a log file at the start of a transaction and never close it until days later. The savepoint attempt fails every time.

How to Fix It

Shorten your transactions. Commit and restart them more often. If you have a long process, split it into smaller transactions. Each transaction should do one logical unit of work and then finish.

For ETL, use staging tables instead of direct file writes inside a transaction. Write to a temp table, then move data in a cleaner transaction. Also, turn off file logging inside transactions — do that outside the transaction scope.

-- Bad pattern
BEGIN TRAN
  OPEN myfile
  -- long operations
  SAVE TRAN mypoint  -- fails here

-- Good pattern
OPEN myfile
BEGIN TRAN
  -- shorter work
  SAVE TRAN mypoint  -- works
COMMIT
CLOSE myfile

Cause #3: File Locks from an External Process

Sometimes it's not your app — it's something else holding a file lock inside the transaction. Antivirus, backup software, or a third-party tool can open a file handle on a database file through the transaction. This is rare but it happens.

I fixed one case where a backup agent was holding a read lock on a temp file during a transaction. The savepoint failed until we disabled that backup job. Another time, a developer had a file open in Notepad++ that was also used in the transaction — yes, really.

How to Fix It

Use Process Monitor (procmon) from Sysinternals. Filter by the transaction's process ID and look for file handles that aren't yours. If you see something like svchost.exe or vssvc.exe holding a lock, that's your culprit. Disable the interfering service, restart the transaction, and try again.

Also check for orphaned file handles. Run this on the SQL Server machine:

handle -a -p sqlservr.exe

Look for files with RW or R that shouldn't be open. If you find one, note the handle number and close it with handle -c <handle_number> -y -p sqlservr.exe. But be careful — closing the wrong handle can crash SQL Server. Only do this if you're sure it's safe.

Quick-Reference Summary

CauseWhat to CheckFix
Open file handles in transactionsys.dm_tran_locks for FILE typeClose files before savepoint
Transaction too longDuration of transactionShorter transactions
External file lockProcess Monitor, Handle toolDisable interfering process
Related Errors in Database Errors
SQL Query Picks Wrong Index? Force It With OPTIMIZE 0X0000028F Fixing ERROR_VOLSNAP_PREPARE_HIBERNATE (0x0000028F) 0X00000884 0X00000884: Service Database Locked — The Real Fix ERROR 1040 (HY000): Too many connections MySQL Error 1040: Too Many Connections Fix

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.