Why This Error Happens
Error 2280 in SQL Server 2025 typically surfaces when the Database Engine cannot resolve metadata for a column or object while a client (SSMS, Azure Data Studio, or a custom app) is actively retrieving data — hence the “Getting Data” status that appears to hang indefinitely. This is most commonly caused by a corrupted statistics object, a blocking session holding a schema-stability (Sch-S) lock, or an Always Encrypted/Column Master Key configuration that the client cannot resolve at query time. In some cases, it is also triggered by a damaged non-clustered index that the Query Optimizer references during data retrieval.
Step-by-Step Resolution Guide
Step 1: Identify Blocking Sessions and Active Locks
- Open SQL Server Management Studio (SSMS) and connect to the instance.
- Run
sp_who2or querysys.dm_exec_requeststo check for sessions in aSUSPENDEDorBLOCKEDstate. - Look specifically for sessions holding
Sch-SorSch-Mlocks on the target table. - If a blocking session is found, note the
SPIDand consider terminating it withKILL <SPID>only after confirming it is safe to do so.
Step 2: Rebuild Statistics and Indexes on the Affected Table
- Open a new query window and run:
EXEC sp_updatestats; - Follow this with a targeted rebuild:
ALTER INDEX ALL ON [YourDatabase].[dbo].[YourTable] REBUILD; - Run
DBCC CHECKTABLE ('YourTable') WITH NO_INFOMSGS, ALL_ERRORMSGS;to confirm there is no underlying corruption causing Error 2280.
Step 3: Verify Always Encrypted / Column Master Key Resolution
- In SSMS, go to Query > Connection > Change Connection, and ensure “Always Encrypted” is enabled if the table uses encrypted columns.
- Confirm the Column Master Key is accessible: navigate to
Database > Security > Always Encrypted Keysin Object Explorer. - On the client machine, verify the certificate exists in
Certificate Manager (certmgr.msc) > Personal > Certificatesand that the calling account has read access to the private key.
Step 4: Restart the SQL Server Service and Clear Cached Plans
- Open Services.msc (Windows Server 2025 / Windows 11) and restart the SQL Server (MSSQLSERVER) service.
- Alternatively, run
DBCC FREEPROCCACHE;to clear any stale execution plans that may be referencing invalid metadata. - Re-run the original query that triggered Error 2280 to confirm resolution.
Alternative or Verification Steps
- Re-execute the original
SELECTstatement or refresh the Object Explorer in SSMS — the query should now return results without hanging or throwing Error 2280. - If the error persists, restore the affected table from a recent backup using
RESTORE DATABASE ... WITH RECOVERYin a test environment, then runDBCC CHECKDBto rule out deeper corruption before re-attempting data retrieval on production.