MetricSign
Start free
High severityresource

SQL Server Error:
1101

What does this error mean?

SQL Server 1101 is thrown when the engine tries to allocate a new page in tempdb but cannot — either the tempdb data files have hit their configured MAXSIZE, the underlying disk volume has no free space, or autogrowth is disabled. In a data-pipeline context this typically surfaces mid-execution: an ADF Copy Activity or Mapping Data Flow triggers a large sort or hash join that spills to disk, tempdb fills up, and the entire pipeline run is killed with a resource-allocation error. The engineer sees a failed pipeline run with no partial output — SQL Server rolls back the incomplete transaction automatically.

Common causes

  • 1Tempdb data files are configured with a hard MAXSIZE cap (e.g. 10 GB) and the disk volume has no room to grow — autogrowth events are silently blocked once the ceiling is hit.
  • 2ADF Mapping Data Flow or SSIS packages perform large multi-way joins or ORDER BY operations that exceed the SQL Server memory grant and spill intermediate results to tempdb; on large datasets these spills can consume tens of gigabytes in minutes.
  • 3Multiple ADF pipelines run concurrently against the same SQL Server instance — each pipeline opens its own tempdb session objects, and the combined allocation exceeds available space with no single pipeline being the obvious culprit.
  • 4Poorly written ETL stored procedures create and drop #temp tables in a loop, or leave temp tables open across batch boundaries; leaked temp tables accumulate over the course of a long pipeline run and are only cleaned up when the session closes.
  • 5Row-version store in tempdb grows unexpectedly when READ_COMMITTED_SNAPSHOT or ALLOW_SNAPSHOT_ISOLATION is enabled and a long-running transaction holds open row versions — common when ADF pipelines run alongside interactive SSMS sessions with open transactions.
  • 6Tempdb is configured with too few data files (often just one), causing severe allocation-page latch contention under concurrent load; SQL Server throttles sessions waiting for SGAM/GAM/PFS pages, and pending allocations pile up until the disk is exhausted.
  • 7Autogrowth increment is set to a small fixed value (e.g. 1 MB default from legacy installs) — each growth event locks tempdb briefly, and under heavy load dozens of micro-growths occur in sequence until disk space runs out entirely.

How to fix it

  1. 1Step 1 — Check current tempdb space and disk availability: SELECT f.name, f.physical_name, f.size*8/1024 AS size_mb, f.max_size, v.available_bytes/1048576 AS disk_free_mb FROM sys.master_files f CROSS APPLY sys.dm_os_volume_stats(f.database_id, f.file_id) v WHERE f.database_id = DB_ID('tempdb');
  2. 2Step 2 — Identify which sessions are consuming tempdb right now: SELECT s.session_id, s.login_name, s.host_name, s.program_name, (t.user_objects_alloc_page_count + t.internal_objects_alloc_page_count) * 8 / 1024 AS tempdb_mb FROM sys.dm_db_session_space_usage t JOIN sys.dm_exec_sessions s ON t.session_id = s.session_id WHERE (t.user_objects_alloc_page_count + t.internal_objects_alloc_page_count) > 0 ORDER BY tempdb_mb DESC; — kill runaway sessions with KILL <session_id> after confirming with the pipeline owner.
  3. 3Step 3 — Expand existing tempdb data files immediately (no restart required): ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, SIZE = 20480MB, MAXSIZE = UNLIMITED, FILEGROWTH = 1024MB); — set MAXSIZE = UNLIMITED only if the disk can support it; otherwise set an explicit ceiling with monitoring.
  4. 4Step 4 — Add additional tempdb data files up to the number of logical CPU cores (max 8) to reduce allocation-page contention: ALTER DATABASE tempdb ADD FILE (NAME = tempdev2, FILENAME = 'D:\tempdb\tempdev2.ndf', SIZE = 20480MB, FILEGROWTH = 1024MB); — repeat for tempdev3 … tempdev8 as needed, keeping all files the same initial size.
  5. 5Step 5 — Check for row-version store bloat if snapshot isolation is in use: SELECT SUM(version_store_reserved_page_count) * 8 / 1024 AS version_store_mb FROM sys.dm_db_file_space_usage WHERE database_id = 2; — if this is large, find the blocking transaction: SELECT transaction_id, elapsed_time_seconds FROM sys.dm_tran_active_snapshot_database_transactions ORDER BY elapsed_time_seconds DESC;
  6. 6Step 6 — Reduce query spills by adding missing indexes on join and sort columns used by the failing pipeline: run the query from the ADF activity against SSMS with SET STATISTICS IO ON and look for 'Workfile' or 'Worktable' in the execution plan; add a covering index on the high-cardinality sort column. In ADF Mapping Data Flow, enable 'Optimize' → 'Single partition' on transformations that don't need parallelism to reduce simultaneous spill threads.
  7. 7Step 7 — Schedule a tempdb health check query as a SQL Agent job or MetricSign alert to fire when free_mb drops below a threshold: SELECT volume_mount_point, available_bytes/1048576 AS free_mb FROM sys.dm_os_volume_stats(2, 1) WHERE available_bytes/1048576 < 5120; — 5 GB headroom is a reasonable minimum for ETL-heavy servers; tune to your pipeline's peak spill size.

Example log output

Msg 1101, Level 17, State 12, Line 1Could not allocate a new page for database 'TEMPDB' 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.Error in ADF activity 'CopyToStagingTable': ErrorCode=SqlOperationFailed, Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException, Message=A database operation failed with the following error: 'Could not allocate space for object '#sort_worktable' in database 'tempdb'...'

Frequently asked questions

SQL Server error 1101 fix — what is the fastest way to free space without restarting SQL Server?

Kill the sessions consuming the most tempdb space (use the dm_db_session_space_usage query in Step 2 above), then immediately expand the existing tempdb files with ALTER DATABASE tempdb MODIFY FILE. No restart is needed — file size changes take effect instantly. Killing sessions will roll back their transactions, so confirm with the pipeline owner before killing ADF sessions.

Will SQL Server 1101 retry automatically in ADF, or do I need to trigger a rerun?

ADF does not auto-retry on SQL Server resource errors like 1101 by default — the activity fails immediately with a UserError. You need to either configure a retry policy on the activity (max retries + retry interval) or rerun the pipeline manually after expanding tempdb. Set retry interval to at least 60 seconds to give the autogrowth event time to complete.

How do I find which query is causing the tempdb spill that triggers 1101?

Run SELECT r.session_id, r.status, r.command, t.text FROM sys.dm_exec_requests r CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) t WHERE r.session_id IN (SELECT session_id FROM sys.dm_db_session_space_usage WHERE internal_objects_alloc_page_count > 1000); — the internal_objects_alloc_page_count column tracks sort and hash spill pages. Open the query plan in SSMS and look for Sort or Hash Match operators with a warning triangle indicating a memory spill.

Does error 1101 occur on Azure SQL Database and Azure SQL Managed Instance?

On Azure SQL Database, tempdb is managed per service tier and you cannot manually expand it — if you hit tempdb limits you must scale up the vCore or DTU tier, or rewrite queries to avoid spills. On Azure SQL Managed Instance you have more control: you can add tempdb files and set MAXSIZE similar to on-premises SQL Server. Check sys.dm_db_file_space_usage to confirm tempdb is the bottleneck before scaling.

Source · learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-1101-database-engine-error

Other resource errors