How to fix Error 159 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 159 — “Must Specify the Table Name and Index Name for the DROP INDEX Statement”

Why This Error Happens

This error occurs because SQL Server 2025 enforces stricter parsing rules for the DROP INDEX statement, requiring the fully qualified format DROP INDEX index_name ON table_name rather than the older, more permissive syntax. Scripts or stored procedures migrated from legacy SQL Server versions (or generated by outdated tools) often omit the ON table_name clause, causing the parser to reject the command. It can also surface when database migration scripts, ORM-generated DDL, or third-party deployment tools have not been updated to comply with the newer T-SQL syntax standards enforced in this release.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Script or Query

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and locate the exact DROP INDEX statement causing Error 159.
  • Check the SQL Server Error Log (via EXEC sp_readerrorlog; or Event Viewer under Applications and Services Logs > MSSQLSERVER) to confirm the exact statement and line number.
  • Note the index name and its associated table from your database schema documentation or by running:
  SELECT i.name AS IndexName, t.name AS TableName
  FROM sys.indexes i
  JOIN sys.tables t ON i.object_id = t.object_id
  WHERE i.name = 'YourIndexName';

Step 2: Correct the DROP INDEX Syntax

  • Rewrite the statement using the mandatory SQL Server 2025 syntax format:
  DROP INDEX IX_YourIndexName ON dbo.YourTableName;
  • If dropping multiple indexes across tables, use one DROP INDEX ... ON ... clause per index, separated by commas:
  DROP INDEX IX_Index1 ON dbo.Table1,
             IX_Index2 ON dbo.Table2;
  • Avoid using the deprecated shorthand DROP INDEX TableName.IndexName, which is no longer supported in this version.

Step 3: Update Migration Scripts and Automation Tools

  • Search all deployment/migration .sql files (typically located in C:\Program Files\Microsoft SQL Server\160\Tools\Scripts\ or your custom deployment repo) for legacy DROP INDEX calls.
  • Update any Entity Framework, SSDT (SQL Server Data Tools), or third-party schema comparison tool templates to generate the corrected syntax.
  • Re-run the corrected script in a test environment first using SSMS’s Query > SQLCMD Mode to catch any remaining syntax issues before deploying to production.

Step 4: Apply and Redeploy

  • Save the corrected script and redeploy it through your standard change management process (e.g., DevOps pipeline, SSMS execution, or Agent Job).
  • If using SQL Server Agent Jobs, edit the job step under SQL Server Agent > Jobs > [Job Name] > Steps and paste the updated command syntax.

Alternative or Verification Steps

  • Verify the fix by re-executing the corrected DROP INDEX statement and confirming no Error 159 appears in the Messages tab of SSMS or in the SQL Server Error Log.
  • As an alternative, use SSMS’s GUI: right-click the index under Object Explorer > Databases > YourDB > Tables > YourTable > Indexes, select Delete, and let SSMS auto-generate the correctly formatted T-SQL script for future reuse.

How to fix Error 155 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 155 – “Is Not a Recognized Option”

Why This Error Happens

Error 155 occurs when SQL Server 2025 parses a T-SQL statement (commonly SET, DBCC, or a stored procedure call) and encounters an option, keyword, or parameter that it does not recognize as valid syntax for that context. This is typically caused by a typo in the option name, use of a deprecated or not-yet-supported option from a different SQL Server version, or a syntax mismatch introduced by copying scripts from an incompatible source (such as an older SSMS template or a third-party migration tool). It can also occur after an in-place upgrade to SQL Server 2025 on Windows Server 2025/Windows 11 where compatibility-level settings have not been updated to match the new engine’s expected syntax.

Step-by-Step Resolution Guide

Step 1: Identify the Exact Statement Causing the Error

  • Open SQL Server Management Studio (SSMS) and locate the failing query in the Query Editor or SQL Server Agent Job History.
  • Check the full error message text, which will specify the exact option name (e.g., 'ROWLOCK', 'FORCE', etc.) and the command context (e.g., SET option).
  • Cross-reference the flagged option against the official Microsoft Docs syntax reference for SQL Server 2025 to confirm whether it was renamed, removed, or requires different casing/spacing.

Step 2: Correct the Syntax or Update the Script

  • Edit the script and correct the misspelled or invalid option, ensuring it matches current SQL Server 2025 T-SQL syntax exactly (options are often case-sensitive to matching keywords, not case-sensitive to SQL Server, but spacing/commas matter).
  • If the option was deprecated, replace it with its modern equivalent (for example, older DBCC trace flag options may need to be replaced with newer catalog view queries).
  • Save the corrected script and re-run it in a Test/Dev environment first:
  -- Example fix: Incorrect
  DBCC CHECKDB ('YourDB') WITH FORCEREPAIR
  -- Corrected
  DBCC CHECKDB ('YourDB') WITH REPAIR_ALLOW_DATA_LOSS

Step 3: Verify Database Compatibility Level

  • Open a new query window and run the following to check the current compatibility level:
  SELECT name, compatibility_level FROM sys.databases WHERE name = 'YourDB';
  • If the database was upgraded from an older version (e.g., SQL Server 2019/2022) and compatibility level is outdated, update it to align with SQL Server 2025 engine features:
  ALTER DATABASE YourDB SET COMPATIBILITY_LEVEL = 170;
  • Restart the SQL Server service via services.msc or PowerShell (Restart-Service MSSQLSERVER) to ensure the new compatibility level is fully applied.

Step 4: Check for Corrupted or Outdated Client Tools

  • Ensure SSMS and any command-line tools (sqlcmd, bcp) are updated to the latest build compatible with SQL Server 2025, as outdated client tools may send malformed syntax.
  • Reinstall or repair SSMS via the Windows 11/Windows Server 2025 Apps & Features panel if the tool itself appears to be generating invalid syntax in auto-generated scripts.

Alternative or Verification Steps

  • Re-run the corrected script in a non-production Test/Dev instance and confirm it executes without Error 155 before deploying to production.
  • If the error persists, use SQL Server Profiler or Extended Events to capture the exact raw SQL text being sent to the engine — this often reveals hidden characters or application-generated syntax errors that aren’t visible in the standard error log.

How to fix Error 156 on Windows Server 2025 / Windows 11

SQL Server 2025 Troubleshooting Guide: Error 156

Why This Error Happens

Error 156 (“Incorrect syntax near the keyword ‘%.*ls'”) occurs when the SQL Server parser encounters a reserved keyword used improperly within a T-SQL statement, typically as an unquoted object name, column alias, or identifier. This is common when reserved words like ORDER, LEVEL, USER, or new SQL Server 2025-specific reserved keywords are used without proper delimiters. It can also surface after an upgrade or compatibility level change, where words that were previously safe to use as identifiers become reserved in the newer engine version.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Keyword and Query Context

  • Locate the exact line number and statement referenced in the error message, using SQL Server Management Studio (SSMS) or Azure Data Studio’s error pane.
  • Cross-reference the flagged word against the official “Reserved Keywords” list in Microsoft Docs for SQL Server 2025.
  • Check if the query was migrated from an older compatibility level (e.g., a linked server or legacy application script).

Step 2: Wrap the Identifier in Delimiters

  • Enclose the offending object name, column, or alias in square brackets, e.g., [Order] instead of Order.
  • Alternatively, use double quotes if QUOTED_IDENTIFIER is set to ON for the session: SET QUOTED_IDENTIFIER ON;
  • Re-run the query in SSMS to confirm the parser accepts the syntax.

Step 3: Review Database Compatibility Level

  • Open SSMS, right-click the database, and navigate to Properties > Options.
  • Check the Compatibility Level field; if set to a newer level (e.g., 170 for SQL Server 2025), verify that legacy scripts do not rely on now-reserved words.
  • Run the following command to check the current level via query:
  SELECT compatibility_level FROM sys.databases WHERE name = 'YourDBName';

Step 4: Update Application Code and Stored Procedures

  • Search all stored procedures, views, and functions for usage of the reserved keyword using:
  SELECT OBJECT_NAME(object_id), definition 
  FROM sys.sql_modules 
  WHERE definition LIKE '%YourKeyword%';
  • Refactor all instances to use bracketed identifiers or rename columns/objects entirely to avoid future conflicts.

Alternative or Verification Steps

  • Verify the fix by executing the corrected script in a test environment first; confirm no Error 156 appears in the Messages tab of SSMS.
  • If the issue persists across multiple objects, consider lowering the database compatibility level temporarily via ALTER DATABASE ... SET COMPATIBILITY_LEVEL = 160; as a short-term workaround while code is refactored.

How to fix Error 157 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 157 – Aggregate in UPDATE SET List

Why This Error Happens

Error 157 occurs because Transact-SQL does not permit aggregate functions (such as SUM, AVG, COUNT, MAX, or MIN) to be used directly within the SET clause of an UPDATE statement. This is a syntax restriction enforced by the SQL Server query parser, not a permissions or connectivity issue. The error typically surfaces when a developer attempts to calculate a running total or summary value inline during an UPDATE, which SQL Server 2025 rejects at the parsing stage before execution even begins.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Open the query in SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your Windows Server 2025 instance.
  • Look for any UPDATE statement where the SET clause contains a direct aggregate call, e.g., UPDATE Sales SET Total = SUM(Amount).
  • Check the SQL Server Error Log at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG to confirm the exact statement and session ID that triggered Error 157.

Step 2: Refactor the Query Using a Subquery or CTE

  • Rewrite the UPDATE statement to move the aggregate calculation into a derived table, subquery, or Common Table Expression (CTE) instead of the SET clause.
  • Example fix:
  WITH AggData AS (
      SELECT CustomerID, SUM(Amount) AS TotalAmount
      FROM Sales
      GROUP BY CustomerID
  )
  UPDATE s
  SET s.Total = a.TotalAmount
  FROM Sales s
  INNER JOIN AggData a ON s.CustomerID = a.CustomerID;
  • This isolates the aggregation logic so SQL Server can compute it before the UPDATE executes.

Step 3: Validate Table Joins and Aliases

  • Ensure the FROM clause in the UPDATE statement correctly references the aggregated subquery or CTE alias.
  • Confirm join keys (e.g., CustomerID) match data types exactly to avoid silent mismatches during the update.
  • Re-run the query in a test environment (e.g., a Windows 11 dev machine with SQL Server 2025 Developer Edition) before deploying to production.

Step 4: Check for Nested Aggregates in Triggers or Stored Procedures

  • Search any stored procedures or triggers tied to the target table for similarly malformed UPDATE statements.
  • Use sp_helptext '<ProcedureName>' in SSMS to review the full procedure body for hidden aggregate misuse.
  • Update all instances using the subquery/CTE pattern from Step 2.

Alternative or Verification Steps

  • Run the corrected UPDATE statement in a transaction (BEGIN TRAN ... ROLLBACK) first to confirm it executes without Error 157, then commit once validated.
  • If the error persists, use SET STATISTICS PROFILE ON before running the query to trace exactly where the parser flags the aggregate, ensuring no other nested aggregate calls remain in the batch.

How to fix Error 151 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 151 – “‘%.*ls’ is an invalid money value”

Why This Error Happens

This error occurs when SQL Server attempts to implicitly or explicitly convert a string or numeric value into the money or smallmoney data type, but the source value contains characters or formatting that the parser cannot interpret. Common root causes include invalid characters (such as multiple decimal points, letters, or unsupported currency symbols), regional/locale mismatches between the client and server (e.g., comma vs. period as a decimal separator), or a value exceeding the precision boundaries supported by the money type. This is a data validation issue rather than a server configuration or permissions problem, but it can be triggered or masked by incorrect collation and locale settings on Windows Server 2025 / Windows 11 environments.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Value or Query

  • Run the failing query in SQL Server Management Studio (SSMS) with SET SHOWPLAN_ALL OFF and check the exact statement returning Error 151.
  • Enable a TRY_CONVERT test to isolate bad rows:
  SELECT column_name FROM table_name 
  WHERE TRY_CONVERT(money, column_name) IS NULL AND column_name IS NOT NULL;
  • Review any ETL/import logs (SSIS packages, BCP, or Bulk Insert) for source file formatting issues.

Step 2: Correct Data Formatting and Regional Settings

  • Ensure input strings use a period (.) as the decimal separator and no thousands separators (e.g., use 1234.56, not 1,234.56).
  • Strip currency symbols ($, €, £) before conversion unless using a locale-aware cast:
  SELECT CONVERT(money, REPLACE(REPLACE(column_name, '$', ''), ',', ''));
  • On Windows Server 2025, verify the regional format under Control Panel > Region > Formats matches the SQL Server instance’s default collation (e.g., en-US vs en-GB decimal separator conflicts).

Step 3: Adjust Source Application or Import Process

  • If the error originates from an SSIS package or BCP import, open the package in Visual Studio/SSDT and check the Data Conversion transformation settings.
  • For BCP/Bulk Insert, specify the correct format file (.fmt) and confirm the field terminator/decimal settings:
  bcp database.dbo.table in datafile.txt -c -t, -r\n -S servername -T
  • Update application-side input validation (e.g., .NET Decimal.TryParse with NumberStyles.Currency) to reject malformed values before they reach SQL Server.

Step 4: Test Conversion Logic with Safe Casting

  • Replace direct CAST/CONVERT calls with TRY_CAST or TRY_CONVERT in stored procedures to gracefully handle invalid values instead of throwing Error 151.
  • Log any NULL results from TRY_CONVERT to a staging/error table for manual review instead of failing the entire batch.

Alternative or Verification Steps

  • Re-run the original query or import job; confirm no Error 151 appears in the SQL Server Error Log (Application event log or sp_readerrorlog).
  • If the issue persists, temporarily change the column data type to NVARCHAR and use TRY_CONVERT in a SELECT to audit all non-conforming values before re-casting to money.

How to fix Error 152 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 152 – Duplicate Large Data Placement Option

Why This Error Happens

This error occurs when a T-SQL statement (typically CREATE TABLE or CREATE INDEX) specifies the same large data placement option—such as a filegroup or partition scheme identifier used for large object (LOB) data—more than once within the same syntax clause. SQL Server’s parser detects this redundant declaration during statement validation and halts compilation, as it cannot determine which duplicate instance should take precedence. This is almost always caused by manually written or auto-generated T-SQL scripts (from ORM tools, migration utilities, or copy-pasted templates) that inadvertently repeat a TEXTIMAGE_ON, FILESTREAM_ON, or similar large-value-type placement clause.

Step-by-Step Resolution Guide

Step 1: Identify the Offending T-SQL Statement

  • Locate the exact CREATE TABLE or CREATE INDEX statement referenced in the error message, using the SSMS query editor line number or the SQL Server error log timestamp.
  • Check for duplicate clauses such as TEXTIMAGE_ON [FileGroupName] or FILESTREAM_ON [PartitionSchemeName] appearing twice in the same statement body.
  • Use sys.dm_exec_query_stats or the deprecated sys.dm_exec_requests (if the session is still active) to pull the exact query text if it was submitted programmatically.

Step 2: Correct the Duplicate Syntax in the Script

  • Open the script in SSMS or Azure Data Studio and manually remove one of the two identical placement clauses.
  • Ensure only a single TEXTIMAGE_ON or FILESTREAM_ON declaration exists per table/index definition, placed after the column definitions and before the closing statement terminator.
  • Example fix:
  -- Incorrect (causes Error 152)
  CREATE TABLE dbo.LargeDataTable (...) 
  TEXTIMAGE_ON FG_LOB TEXTIMAGE_ON FG_LOB;

  -- Corrected
  CREATE TABLE dbo.LargeDataTable (...) 
  TEXTIMAGE_ON FG_LOB;

Step 3: Audit Auto-Generated Scripts or ORM Templates

  • If the script was generated by Entity Framework, SSDT, or a third-party migration tool, check the template/model definition for a misconfigured mapping that emits the placement option twice.
  • Regenerate the script after correcting the source model, and re-run it against a test database on Windows Server 2025 to confirm clean execution.

Step 4: Re-Deploy and Validate the Schema Change

  • Run the corrected script in a non-production environment first using sqlcmd -S <ServerInstance> -i FixedScript.sql -b.
  • Confirm no Error 152 (or related Errors 150/151 for similar placement conflicts) appears in the output or in SQL Server Management Studio‘s Messages tab.

Alternative or Verification Steps

  • Verify the fix by querying sys.tables and sys.filegroups after execution to confirm the table was created with the single, correct filegroup assignment (SELECT name, filegroup_id FROM sys.tables WHERE name = 'LargeDataTable';).
  • If the error persists intermittently, check for multiple T-SQL batches being concatenated by a deployment pipeline (e.g., DACPAC or SSDT publish profile) that may duplicate the clause during merge—review the .sqlproj build output for duplicated table definitions before deployment.

How to fix Error 153 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 153 – Invalid Usage of Option

Why This Error Happens

Error 153 occurs when a T-SQL statement includes an option or clause that is syntactically incompatible with the rest of the query, such as combining ORDER BY with certain set operators, or misusing hints like OPTION, WITH TIES, or OFFSET/FETCH outside their supported context. This is typically a query construction issue rather than a server configuration problem, but it can also surface after a SQL Server version upgrade (such as migrating to SQL Server 2025) where deprecated syntax patterns from legacy applications are no longer silently tolerated. In some cases, ORM-generated queries or stored procedures written for older compatibility levels trigger this error because the database’s compatibility level does not match the syntax being used.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement

  • Check the SQL Server Error Log or Extended Events session for the exact query text associated with Error 153.
  • Use SELECT * FROM sys.dm_exec_query_stats cross-applied with sys.dm_exec_sql_text to locate the recent statement if it was captured before failing.
  • Look specifically for ORDER BY, OFFSET, FETCH, TOP, or OPTION clauses combined with UNION, INTERSECT, or EXCEPT.

Step 2: Correct the Syntax Structure

  • Ensure ORDER BY only appears once, at the end of the final query in a UNION/INTERSECT/EXCEPT chain, not in individual sub-selects.
  • If using OFFSET/FETCH, confirm it is paired correctly with an ORDER BY clause in the same statement.
  • Remove or reposition query hints (e.g., OPTION (RECOMPILE)) so they apply only to the outermost statement, not subqueries.
  • Example fix:
  SELECT col1 FROM TableA
  UNION
  SELECT col1 FROM TableB
  ORDER BY col1 OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY;

Step 3: Check Database Compatibility Level

  • Run SELECT name, compatibility_level FROM sys.databases WHERE name = 'YourDB'; to confirm the current level.
  • If the database was upgraded from an older SQL Server version, update it using:
  ALTER DATABASE YourDB SET COMPATIBILITY_LEVEL = 160;
  • Test the query again after adjusting compatibility level, since newer levels enforce stricter syntax validation.

Step 4: Review Application or ORM-Generated Queries

  • If the query originates from an ORM (Entity Framework, Hibernate, etc.), inspect the generated SQL using SQL Server Profiler or Extended Events.
  • Update the ORM query builder logic or raw SQL templates to avoid unsupported clause combinations flagged by SQL Server 2025.

Alternative or Verification Steps

  • Re-run the corrected query in SSMS or Azure Data Studio and confirm it executes without Error 153, then monitor the Application Event Log on Windows Server 2025 for recurrence.
  • If the error persists in a third-party application, temporarily enable SQL Server’s “Deprecated Features” Extended Events session to capture and confirm which specific option is invalid before escalating to the vendor.

How to fix Error 154 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 154 — “%SMSG is not allowed in %SMSG”

Why This Error Happens

Error 154 in Microsoft SQL Server 2025 occurs when a Data Manipulation Language (DML) statement or clause is used in a context where SQL Server’s parser explicitly disallows it — commonly when placing an ORDER BY clause inside a view, inline function, or derived table definition without a TOP, OFFSET, or FOR XML modifier. This is a syntax-scope violation rather than a permissions or connectivity issue, meaning the T-SQL batch itself violates SQL Server’s object-definition rules. It frequently surfaces after migrating legacy T-SQL scripts to SQL Server 2025, as stricter parser validation may catch constructs that were previously tolerated or auto-corrected in older engine versions.

Step-by-Step Resolution Guide

Step 1: Identify the Exact Statement Triggering Error 154

  • Open SQL Server Management Studio (SSMS) connected to your Windows Server 2025 instance and re-run the failing script in isolation.
  • Check the Messages tab for the precise line number and object name (view, function, or stored procedure) referenced in the %S_MSG placeholders.
  • Cross-reference the object definition using sys.sql_modules if the error originates from a stored object:
  SELECT definition FROM sys.sql_modules WHERE object_id = OBJECT_ID('YourObjectName');

Step 2: Correct the Invalid Clause Placement

  • If the error involves a view or inline table-valued function, remove any standalone ORDER BY clause that lacks TOP, OFFSET/FETCH, or FOR XML.
  • Rewrite the object to move sorting logic to the outer query instead of embedding it inside the view/function body:
  -- Invalid inside a view:
  ORDER BY ColumnName

  -- Valid alternative:
  SELECT TOP (100) PERCENT ColumnName FROM TableName ORDER BY ColumnName
  • Apply the same review to any INSERT, UPDATE, or DELETE statements nested improperly inside CTEs (Common Table Expressions) or subqueries, as these are also restricted contexts under strict parsing.

Step 3: Update Compatibility Level and Re-Validate Scripts

  • Check the database compatibility level, since SQL Server 2025 enforces newer parser rules at higher compatibility levels:
  SELECT compatibility_level FROM sys.databases WHERE name = 'YourDatabaseName';
  • If scripts were written for older compatibility levels (130 or below), test both raising to 170 (2025 native) and temporarily lowering to isolate whether the issue is compatibility-driven:
  ALTER DATABASE YourDatabaseName SET COMPATIBILITY_LEVEL = 170;
  • Re-deploy the corrected object definition using CREATE OR ALTER to avoid orphaned permissions on the original object.

Step 4: Rebuild Affected Views or Procedures

  • Drop and recreate any view/function that previously relied on deprecated syntax patterns rather than using ALTER, since cached execution plans may retain the invalid parse tree.
  • Clear the procedure cache for the specific database to eliminate stale plan references:
  DBCC FREEPROCCACHE;

Alternative or Verification Steps

  • Verify the fix by executing the corrected object standalone (SELECT * FROM dbo.YourView; or EXEC dbo.YourProcedure;) and confirming Error 154 no longer appears in the Messages pane.
  • If the error persists after syntax correction, run DBCC CHECKDB('YourDatabaseName') to rule out metadata corruption affecting the system catalog views (sys.sql_modules, sys.objects) that store the object definitions.

How to fix Error 148 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 148 – Incorrect Time Syntax in WAITFOR

Why This Error Happens

Error 148 occurs when the WAITFOR statement receives a time string that does not conform to the expected hh:mm:ss or hh:mm:ss.mmm format required by SQL Server 2025. This is typically caused by passing a malformed variable, an incorrectly concatenated string, or a regional/locale-based date format mismatch (e.g., using a DATETIME string instead of a TIME string). Additionally, dynamic SQL that builds the WAITFOR command using improperly cast variables can inject invalid characters or an unsupported delimiter into the time string.

Step-by-Step Resolution Guide

Step 1: Validate the Time String Syntax

  • Ensure the string strictly follows the hh:mm:ss format (24-hour clock), for example: WAITFOR TIME '14:30:00'.
  • Check for the use of AM/PM designators, which are not supported by WAITFOR TIME and will trigger Error 148.
  • Verify there are no leading/trailing spaces or non-printable characters in the variable being passed.

Step 2: Correct Variable Casting in T-SQL Scripts

  • If using a variable, explicitly cast it to the TIME data type before passing it to WAITFOR:
  DECLARE @WaitTime TIME = '00:00:05';
  WAITFOR DELAY @WaitTime;
  • Avoid using DATETIME or DATETIME2 variables directly in WAITFOR TIME; convert them first using CONVERT(TIME, @YourVariable).
  • Re-run the script in SQL Server Management Studio (SSMS) to confirm the cast resolves the parsing error.

Step 3: Check Server Locale and Language Settings

  • Navigate to SQL Server Configuration Manager on Windows Server 2025 and verify the default language settings for the SQL Server instance match the expected locale (e.g., en-US).
  • Run SELECT @@LANGUAGE; in a new query window to confirm the current session language.
  • If the language setting is causing a mismatch in delimiter expectations (commas vs. periods), reset it using: EXEC sp_configure 'default language', 0; followed by RECONFIGURE;.

Step 4: Audit Dynamic SQL Concatenation

  • If the WAITFOR command is built via dynamic SQL (EXEC(@SQLString)), print the string to the console using PRINT @SQLString before execution to visually inspect the syntax.
  • Look for missing single quotes around the time value or double-escaped characters resulting from improper string concatenation logic.

Alternative or Verification Steps

  • Verification: Execute the corrected query in a test environment and check the SQL Server Error Log via SSMS > Management > SQL Server Logs to confirm Error 148 no longer appears during execution.
  • Alternative: If the issue persists due to complex date logic, replace WAITFOR TIME with WAITFOR DELAY combined with a calculated DATEDIFF function to determine the exact wait duration programmatically, bypassing static string parsing entirely.

How to fix Error 149 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 149 — Invalid WAITFOR Time Value

Why This Error Happens

Error 149 occurs when the WAITFOR DELAY or WAITFOR TIME statement receives a string that does not conform to the expected hh:mm:ss[.mmm] (for DELAY) or valid time/datetime format (for TIME). This is frequently caused by locale/regional formatting mismatches on Windows Server 2025, incorrect string concatenation in dynamically generated T-SQL, or passing a datetime/varchar value that includes date components where only a time offset is expected. It can also surface after a session’s LANGUAGE or DATEFORMAT setting is altered, causing SQL Server to misinterpret an otherwise valid-looking time string.

Step-by-Step Resolution Guide

Step 1: Validate the WAITFOR Syntax in Your Script

  • Confirm the exact string being passed to WAITFOR DELAY or WAITFOR TIME.
  • Correct format for DELAY: 'HH:MM:SS' (e.g., WAITFOR DELAY '00:00:30').
  • Correct format for TIME: 'HH:MM:SS' (e.g., WAITFOR TIME '14:30:00').
  • Do not include date parts, timezone offsets, or milliseconds beyond 3 digits unless explicitly supported.
  • If using a variable, run SELECT @YourVariable immediately before the WAITFOR call to confirm its literal value.

Step 2: Check Session Language and DATEFORMAT Settings

  • Run SELECT @@LANGUAGE; and DBCC USEROPTIONS; to inspect current session settings.
  • Regional settings inherited from Windows Server 2025 or Windows 11 (via Control Panel > Region or intl.cpl) can alter how SQL Server’s client driver formats time strings before submission.
  • Explicitly set the session language if needed: SET LANGUAGE 'English';
  • Avoid relying on implicit locale-based conversions; always cast explicitly using CONVERT(varchar(8), @time, 108).

Step 3: Audit Dynamic SQL and Application Code

  • If the WAITFOR call is generated by an application or ORM, log the exact string sent to SQL Server (use SQL Server Profiler or Extended Events with the sql:BatchStarting event).
  • Check for string concatenation errors, such as appended AM/PM markers, extra whitespace, or NULL values coerced into empty strings.
  • Fix the source code to explicitly format the value: FORMAT(GETDATE(), 'HH:mm:ss') on the application side, or CONVERT(varchar(8), GETDATE(), 108) in T-SQL.

Step 4: Update SQL Server 2025 Cumulative Updates

  • Confirm your build number via SELECT @@VERSION;.
  • Apply the latest Cumulative Update (CU) from Microsoft, as time-parsing edge cases in WAITFOR have been patched in prior SQL Server releases.
  • Restart the SQL Server service (services.msc → SQL Server (MSSQLSERVER)) after patching.

Alternative or Verification Steps

  • Re-run the corrected WAITFOR statement in SQL Server Management Studio (SSMS) using a static, known-good value (e.g., WAITFOR DELAY '00:00:05';) to confirm the syntax executes without Error 149.
  • If the issue persists only under the application context (not in SSMS), isolate it as a client-driver locale issue and force UTC/invariant culture formatting in the application’s connection string or code layer before resubmitting.

How to fix Error 150 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 150 – Invalid MAX_DURATION Value

Why This Error Happens

This error occurs when the MAX_DURATION parameter, typically used in ALTER INDEX ... RESUME or resumable index rebuild operations, is passed a value that falls outside the acceptable numeric range. SQL Server 2025 requires this wait time to be a non-negative integer that does not exceed the internal maximum threshold defined by the engine. This is commonly caused by a scripting error, an incorrect variable substitution in an automated maintenance job, or a misconfigured T-SQL script that passes a negative number, a null-derived value, or an excessively large integer to the parameter.

Step-by-Step Resolution Guide

Step 1: Review the T-SQL Script Triggering the Error

  • Locate the exact query or stored procedure calling ALTER INDEX with MAX_DURATION, often found in maintenance plans or SQL Agent Jobs.
  • Check for dynamic SQL blocks where %d (the duration variable) may be getting a NULL, negative, or unbounded value due to a calculation error.
  • Command example to inspect job history:
  SELECT * FROM msdb.dbo.sysjobhistory WHERE run_status = 0;

Step 2: Correct the MAX_DURATION Value

  • Ensure the value passed is an integer representing minutes, not seconds or milliseconds (a common conversion mistake).
  • The value must be greater than or equal to 0.
  • Verify the value does not exceed the maximum allowed threshold (the specific upper limit indicated by %d in the second half of the error message, usually capped based on int data type limits in SQL Server 2025).
  • Update the script syntax to match this format:
  ALTER INDEX ALL ON dbo.YourTable 
  RESUME (MAX_DURATION = 60 MINUTES);

Step 3: Check for Corrupted Job Variables or Registry Overrides

  • Open SQL Server Management Studio (SSMS) and navigate to SQL Server Agent > Jobs.
  • Right-click the specific job step, select Edit, and manually retype the MAX_DURATION value to rule out invisible character corruption (e.g., hidden Unicode characters copied from external documentation).
  • On Windows Server 2025, verify no Group Policy or SQL Server Configuration Manager settings are overriding session timeout variables that might interact with the duration parameter.

Step 4: Restart the SQL Server Service to Clear Cached Execution Plans

  • Open PowerShell as Administrator and run:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • This clears any cached execution plans that might have stored the invalid parameter value from a previous compile.

Alternative or Verification Steps

  • To verify the fix, run the corrected ALTER INDEX command manually in SSMS and confirm the operation begins without throwing Error 150; check the Messages tab for a successful “Command(s) completed successfully” output.
  • If the error persists despite correct syntax, check the SQL Server Error Log via EXEC sp_readerrorlog; to confirm the engine is reading the updated script rather than a cached or replicated version stored in a linked server configuration.

How to fix Error 145 on Windows Server 2025 / Windows 11

Troubleshooting Guide: MSSQL Error 145 — ORDER BY / SELECT DISTINCT Conflict

Why This Error Happens

This error occurs because SQL Server’s query engine cannot guarantee deterministic result ordering when a DISTINCT operation removes duplicate rows based on the SELECT list, but the ORDER BY clause references a column that isn’t part of that list. Since duplicate elimination happens before sorting, SQL Server requires every sort key to be visible in the output columns to avoid ambiguous row grouping. This is a T-SQL syntax/logic validation error (Error 145) triggered during query parsing, not a server, permissions, or OS-level fault, though it commonly surfaces after application or reporting-layer updates on Windows Server 2025 / Windows 11 environments running SQL Server 2025.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to your SQL Server 2025 instance.
  • Locate the exact query from the application log, stored procedure, or job step referenced in the Windows Event Viewer (Application log, Source: MSSQLSERVER, Event ID 145).
  • Copy the query into a new query window for isolated testing.

Step 2: Align SELECT and ORDER BY Columns

  • Add every column referenced in ORDER BY directly into the SELECT DISTINCT list.
  • Example fix:
  -- Broken
  SELECT DISTINCT CustomerName FROM Sales ORDER BY OrderDate;

  -- Fixed
  SELECT DISTINCT CustomerName, OrderDate FROM Sales ORDER BY OrderDate;
  • If exposing the extra column is undesirable, wrap the query in a subquery or CTE and select only the needed columns in the outer query without DISTINCT.

Step 3: Refactor Using Window Functions (If Needed)

  • For cases requiring distinct rows sorted by a non-selected column, use ROW_NUMBER() with PARTITION BY instead of DISTINCT.
  • Example:
  SELECT CustomerName FROM (
    SELECT CustomerName, OrderDate,
    ROW_NUMBER() OVER (PARTITION BY CustomerName ORDER BY OrderDate DESC) AS rn
    FROM Sales
  ) t WHERE rn = 1;
  • This avoids the DISTINCT + ORDER BY conflict entirely while preserving sort logic.

Step 4: Update Application/ORM Query Templates

  • If the query originates from an ORM (Entity Framework, Dapper, etc.) or reporting tool (SSRS/Power BI on Windows Server 2025), locate the generated SQL template.
  • Modify the query builder logic to include sort columns in projection lists, or disable auto-generated DISTINCT clauses where unnecessary.

Alternative or Verification Steps

  • Re-run the corrected query in SSMS and confirm it executes without Error 145, then check the Windows Event Viewer to confirm no new Event ID 145 entries appear.
  • As an alternative, use GROUP BY in place of SELECT DISTINCT when you need aggregation-based uniqueness, since GROUP BY allows sorting on non-grouped aggregate expressions more flexibly.

How to fix Error 146 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 146 – Maximum Number of Tables in a Query Exceeded

Why This Error Happens

This error occurs when a single query, particularly one containing deeply nested subqueries, views, or complex joins, causes SQL Server’s internal query processor to exceed its hard-coded limit of 256 tables per query (including ancillary/hidden tables generated by the optimizer). Each referenced view, derived table, or CTE consumes “table slots” internally, and heavily nested views or auto-generated ORM queries often multiply this count far beyond what is visually apparent in the T-SQL script. This is not a data corruption issue but rather a query design and complexity limitation within the SQL Server engine itself.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Use SQL Server Profiler or Extended Events to capture the exact query text triggering Error 146.
  • Check the query for nested views (views referencing other views) or multiple UNION/JOIN statements stacked together.
  • Look specifically for ORM-generated queries (Entity Framework, Hibernate) which often auto-generate excessive joins.

Step 2: Simplify Nested Views and Subqueries

  • Flatten nested views by rewriting them as direct table joins instead of layering View A on top of View B on top of View C.
  • Replace correlated subqueries with Common Table Expressions (CTEs) or temporary tables to reduce the ancillary table count.
  • Break a single massive query into multiple smaller queries, storing intermediate results in temporary tables (e.g., #TempResults) located in tempdb.

Step 3: Refactor Using Temporary Tables

  • Create explicit temporary tables to materialize subquery results rather than relying on inline derived tables.
  • Example: SELECT * INTO #Step1 FROM dbo.LargeView WHERE Condition = 1; then join #Step1 in the next query stage.
  • This reduces the “ancillary table” overhead the optimizer must track for a single execution plan.

Step 4: Update Statistics and Rebuild Indexes

  • Run EXEC sp_updatestats; on the target database to ensure the query optimizer isn’t compensating for stale statistics with additional internal restructuring.
  • Rebuild fragmented indexes using ALTER INDEX ALL ON [TableName] REBUILD; to help the optimizer generate a more efficient (and less table-heavy) execution plan.

Step 5: Apply the Latest Cumulative Update

  • Verify you are running the latest Cumulative Update (CU) for SQL Server 2025, as query optimizer enhancements are frequently patched.
  • Navigate to Microsoft’s official Download Center and cross-reference your current build number via SELECT @@VERSION; in SSMS.

Alternative or Verification Steps

  • Verify the fix by re-running the original query in SQL Server Management Studio (SSMS); if Error 146 is resolved, the query should return results without terminating early.
  • As an alternative, use the Database Engine Tuning Advisor to analyze the workload and suggest an optimized indexing/view structure that reduces the total table reference count.

How to fix Error 147 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 147 — Aggregate in WHERE Clause

Why This Error Happens

This error occurs because SQL Server’s query processor does not allow aggregate functions (such as SUM(), COUNT(), AVG(), MAX(), or MIN()) to be evaluated directly within a WHERE clause. This is a logical processing order issue: the WHERE clause is evaluated before aggregation occurs in the query execution plan, so the aggregate value simply does not exist yet at that stage. This is not a bug, permission issue, or corruption — it is a T-SQL syntax and query logic violation that must be corrected in the query itself.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio on your Windows Server 2025 / Windows 11 machine.
  • Locate the exact query throwing Error 147 by checking the Messages tab in SSMS after execution.
  • Look specifically for aggregate functions (SUM, COUNT, AVG, MAX, MIN) used inside a WHERE clause condition.

Step 2: Refactor Using HAVING Clause (for Grouped Aggregates)

  • If the aggregate is meant to filter grouped results, move the condition from WHERE to a HAVING clause.
  • Example fix:
  SELECT CustomerID, SUM(OrderTotal) AS TotalSpent
  FROM Orders
  GROUP BY CustomerID
  HAVING SUM(OrderTotal) > 1000;
  • Ensure the GROUP BY clause is present and correctly references the non-aggregated columns.

Step 3: Refactor Using a Subquery or CTE (for Row-Level Filtering)

  • If you need to filter individual rows based on an aggregate calculated elsewhere, wrap the aggregate in a subquery or Common Table Expression (CTE).
  • Example fix using a CTE:
  WITH SalesSummary AS (
      SELECT CustomerID, SUM(OrderTotal) AS TotalSpent
      FROM Orders
      GROUP BY CustomerID
  )
  SELECT * FROM SalesSummary WHERE TotalSpent > 1000;
  • This allows the aggregate to be fully computed in an inner query/CTE before being referenced in the outer WHERE clause.

Step 4: Validate Query Execution Plan

  • Re-run the corrected query in SSMS and confirm it executes without Error 147.
  • Use “Include Actual Execution Plan” (Ctrl+M) to confirm the aggregation step is now happening before the filter is applied on the outer level.

Alternative or Verification Steps

  • Run the query against a small test dataset first to confirm the output matches expected business logic (e.g., correct totals, correct row counts) before deploying to production.
  • If the query is part of a stored procedure or reporting tool (e.g., SSRS, Power BI dataset), clear the query cache or recompile the stored procedure using sp_recompile 'YourProcName' after the fix to ensure the old invalid execution plan is discarded.

How to fix Error 142 on Windows Server 2025 / Windows 11

Why This Error Happens

Error 142 occurs when SQL Server’s parser encounters malformed T-SQL syntax while defining a CHECK, DEFAULT, FOREIGN KEY, PRIMARY KEY, or UNIQUE constraint, typically due to mismatched parentheses, incorrect keyword ordering, or unsupported expressions inside the constraint definition. This is often introduced when scripts are migrated from older SQL Server versions or generated by third-party ORM tools that use deprecated syntax patterns not supported in SQL Server 2025. It can also occur when copy-pasted scripts include invisible Unicode characters or incorrect delimiters that corrupt the constraint clause.

Step-by-Step Resolution Guide

Step 1: Isolate the Offending Constraint Definition

  • Open the failing script in SQL Server Management Studio (SSMS) 21 or Azure Data Studio.
  • Locate the exact line referenced in the error message (the ‘%ls’ placeholder will show the constraint name in the actual error output).
  • Copy just the ALTER TABLE ... ADD CONSTRAINT or CREATE TABLE block into a new query window for isolated testing.

Step 2: Validate Syntax Structure Against SQL Server 2025 Standards

  • Confirm CHECK constraints use valid boolean expressions, e.g. CHECK (Age >= 0 AND Age <= 120).
  • Ensure FOREIGN KEY constraints follow the pattern: FOREIGN KEY (ColumnName) REFERENCES TableName(ColumnName).
  • Verify all parentheses are balanced and terminated with a semicolon.
  • Remove any deprecated syntax such as WITH NOCHECK placed incorrectly before the constraint type keyword.

Step 3: Strip Hidden or Non-Standard Characters

  • Retype the constraint clause manually in a plain text editor (e.g., Notepad) to eliminate invisible Unicode or smart-quote characters copied from Word or PDF sources.
  • Save the file with UTF-8 (without BOM) encoding before re-running it in SSMS.

Step 4: Re-run the Corrected Script

  • Execute the corrected ALTER TABLE or CREATE TABLE statement in a test database first.
  • Run the command:
sqlcmd -S localhost -d YourDatabase -i "C:\Scripts\FixConstraint.sql"
  • Confirm no Error 142 is returned in the output.

Alternative or Verification Steps

  • Verify the fix by querying sys.check_constraints or sys.foreign_keys to confirm the constraint was created successfully: SELECT name, definition FROM sys.check_constraints WHERE name = 'YourConstraintName';
  • If the error persists, drop and recreate the entire table using the SSMS “Generate Scripts” wizard to auto-format constraint syntax correctly for SQL Server 2025.

How to fix Error 143 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 143 — “A COMPUTE BY item was not found in the order by list”

Why This Error Happens

This error occurs because SQL Server’s COMPUTE BY clause requires that every column referenced in the COMPUTE BY list also appear, in the same order, within the query’s ORDER BY clause. When a query is written with a COMPUTE BY expression that references a column absent from ORDER BY — or listed in a mismatched sequence — the SQL Server 2025 query parser rejects the statement before execution. This is not a permissions, port, or corruption issue; it is a strict T-SQL syntax validation rule tied to how COMPUTE BY generates subtotal breaks based on sort order.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and locate the exact query returning Error 143.
  • Check the SQL Server error log at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the timestamp and session ID tied to the failure.
  • Extract the full SELECT ... COMPUTE BY ... statement for review.

Step 2: Align the ORDER BY and COMPUTE BY Clauses

  • Ensure every column listed in COMPUTE BY is also present in ORDER BY, in the exact same left-to-right order.
  • Example fix:
  • Incorrect: ORDER BY CustomerID SELECT ... COMPUTE SUM(Amount) BY Region
  • Corrected: ORDER BY Region, CustomerID SELECT ... COMPUTE SUM(Amount) BY Region
  • Update the query in your application code, stored procedure, or SSMS query window accordingly.

Step 3: Consider Modernizing Deprecated Syntax

  • Note that COMPUTE BY is a deprecated feature retained for backward compatibility in SQL Server 2025.
  • Replace COMPUTE BY logic with GROUP BY combined with ROLLUP, CUBE, or window functions (SUM() OVER (PARTITION BY ...)) for better performance and long-term supportability.
  • Test the rewritten query in a non-production environment first to confirm equivalent output.

Step 4: Redeploy and Re-execute

  • Save the corrected script and redeploy it to the stored procedure, SSIS package, or application layer that originally triggered the error.
  • Restart the SQL Server Agent job (if applicable) via services.msc or sqlcmd -S <ServerName> -Q "EXEC msdb.dbo.sp_start_job N'JobName'" to confirm the fix takes effect.

Alternative or Verification Steps

  • Run the corrected query directly in SSMS against a test database to confirm it executes without Error 143 and returns expected subtotal breaks.
  • If rewriting isn’t immediately feasible, use SET FMTONLY ON (in compatible modes) or a query validation tool to catch COMPUTE BY/ORDER BY mismatches before deployment to production pipelines.

How to fix Error 144 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 144

Why This Error Happens

This error occurs because Transact-SQL syntax rules do not permit aggregate functions (such as SUM, COUNT, AVG) or subqueries to appear directly within the GROUP BY clause. SQL Server processes GROUP BY before aggregates are calculated, so the engine has no valid way to group rows by a value that hasn’t been computed yet. This is typically caused by a query logic error rather than a server configuration or permissions issue, often introduced during query migration or manual query writing.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Open SQL Server Management Studio (SSMS) 21 and locate the query referenced in the error log or application trace.
  • Check the GROUP BY clause for any function calls like COUNT(), SUM(), AVG(), MAX(), or MIN().
  • Look for nested SELECT statements (subqueries) placed inside the GROUP BY list.

Step 2: Refactor the Query Structure

  • Move any aggregate function out of the GROUP BY clause and into the SELECT list instead.
  • Ensure the GROUP BY clause only contains raw column names or non-aggregated expressions.
  • If a subquery is required for grouping, resolve it first using a Common Table Expression (CTE) or a derived table, then group by the resulting column.
  • Example fix:
  -- Incorrect
  SELECT CustomerID, SUM(OrderTotal)
  FROM Orders
  GROUP BY CustomerID, SUM(OrderTotal);

  -- Corrected
  SELECT CustomerID, SUM(OrderTotal)
  FROM Orders
  GROUP BY CustomerID;

Step 3: Use HAVING for Aggregate Filtering

  • If the intent was to filter results based on an aggregate value, replace that logic with a HAVING clause instead of placing it in GROUP BY.
  • Example: HAVING SUM(OrderTotal) > 1000 instead of grouping by the sum.

Step 4: Validate Subquery Placement

  • If a subquery was mistakenly placed in the GROUP BY, rewrite it as a JOIN or a CTE at the top of the query.
  • Reference the calculated column from the CTE/derived table in the GROUP BY clause instead of the raw subquery.

Alternative or Verification Steps

  • Run the corrected query in SSMS or Azure Data Studio and confirm it executes without Error 144 in the Messages pane.
  • If the issue persists in a stored procedure, use sp_helptext 'ProcedureName' to review the full definition and confirm no other nested aggregates remain in grouping logic.

How to fix Error 139 on Windows Server 2025 / Windows 11

Why This Error Happens

SQL Server Error 139 occurs when a stored procedure or function parameter is declared with a default value that is not a true constant—most commonly a system function (like GETDATE(), NEWID(), or SCOPE_IDENTITY()), a subquery, or a reference to another variable. The SQL Server 2025 parser strictly requires that DEFAULT values in parameter declarations resolve to literal constants or NULL at compile time. This issue is frequently introduced during code migration from legacy T-SQL scripts or when developers assume parameter defaults behave like variable assignments inside a procedure body.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Parameter Declaration

  • Open the stored procedure or function definition in SQL Server Management Studio (SSMS) 21 or Azure Data Studio.
  • Locate the CREATE PROCEDURE or CREATE FUNCTION header and inspect every parameter using the = DEFAULT syntax.
  • Look specifically for non-constant expressions such as @Date DATETIME = GETDATE() or @ID INT = (SELECT MAX(ID) FROM dbo.Table).

Step 2: Refactor the Default Value Assignment

  • Replace the invalid default with a valid constant or NULL, for example: @Date DATETIME = NULL.
  • Move the dynamic logic (function calls, subqueries) inside the procedure body using an IF @Date IS NULL SET @Date = GETDATE() pattern.
  • Save the corrected script and re-run it against your target database using sqlcmd -S <ServerName> -i FixedProc.sql or execute directly in SSMS.

Step 3: Validate Compatibility Level and Rebuild the Object

  • Confirm the database compatibility level supports the syntax you are using by running:
    SELECT compatibility_level FROM sys.databases WHERE name = 'YourDBName';
  • If the compatibility level is outdated (below 160 for SQL Server 2025 features), update it with:
    ALTER DATABASE YourDBName SET COMPATIBILITY_LEVEL = 170;
  • Drop and recreate the procedure/function to force SQL Server to recompile and validate the corrected parameter defaults.

Step 4: Clear Cached Execution Plans (If Error Persists)

  • On Windows Server 2025, open SSMS and run DBCC FREEPROCCACHE; to clear any stale plans referencing the old, broken definition.
  • Restart the SQL Server service via Services.msc or net stop MSSQLSERVER && net start MSSQLSERVER if the cache clear does not resolve the compile error.

Alternative or Verification Steps

  • Verify the fix by executing the procedure with no parameters passed (EXEC dbo.YourProc;) and confirming it runs without raising Error 139.
  • If the error still appears, check for nested or wrapped procedure calls that inherit the same faulty parameter pattern, and repeat Steps 1–3 for each affected object.

How to fix Error 140 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 140 — “Can Only Use IF UPDATE Within a CREATE TRIGGER Statement”

Why This Error Happens

This error occurs when the IF UPDATE(column_name) clause is referenced outside the body of a CREATE TRIGGER or ALTER TRIGGER statement, which SQL Server 2025’s parser strictly rejects. It commonly happens due to a misplaced batch separator (GO), a copy-paste error that split the trigger definition across two batches, or a malformed script where the trigger body is not correctly enclosed within BEGIN...END. Occasionally, this also surfaces when a stored procedure or ad-hoc query attempts to reuse trigger-specific syntax that is invalid outside the trigger execution context.

Step-by-Step Resolution Guide

Step 1: Verify the Script Structure and Batch Separation

  • Open the .sql file in SQL Server Management Studio (SSMS) or Azure Data Studio.
  • Check for an accidental GO statement placed between CREATE TRIGGER trg_Name ON dbo.TableName and the IF UPDATE(...) logic.
  • Ensure there is no semicolon or batch break interrupting the trigger definition before the IF UPDATE clause is reached.

Step 2: Confirm the Trigger Body Encapsulation

  • Make sure the entire trigger logic, including IF UPDATE(column_name), sits inside the BEGIN...END block directly following the AFTER INSERT, UPDATE, DELETE clause.
  • Example of correct syntax:
  • CREATE TRIGGER trg_CheckUpdate ON dbo.Employees AFTER UPDATE AS BEGIN IF UPDATE(Salary) BEGIN PRINT 'Salary was updated'; END END
  • Remove any nested CREATE TRIGGER or EXEC calls that attempt to wrap IF UPDATE a second time.

Step 3: Rebuild the Trigger from a Clean Template

  • Drop the faulty trigger using DROP TRIGGER dbo.trg_CheckUpdate; in a new query window on Windows Server 2025.
  • Re-create the trigger using the Microsoft-recommended template found in C:\Program Files\Microsoft SQL Server\160\Tools\Templates\Sql\Trigger\ (or the equivalent 2025 template path).
  • Paste your business logic only inside the BEGIN...END block, ensuring IF UPDATE is never referenced at the top level of the script.

Step 4: Validate Permissions and Compatibility Level

  • Run SELECT compatibility_level FROM sys.databases WHERE name = 'YourDatabaseName'; to confirm the database is not running in a legacy compatibility mode that alters trigger parsing behavior.
  • Ensure the executing login has ALTER permission on the target table via SELECT * FROM fn_my_permissions('dbo.TableName', 'OBJECT');.

Alternative or Verification Steps

  • After redeploying the trigger, test it by running a sample UPDATE dbo.TableName SET Column = Value WHERE Id = 1; and confirm the trigger fires without throwing Error 140 in the Messages tab.
  • If the error persists, use sp_helptext 'trg_CheckUpdate' to dump the live definition from the server and visually diff it against your local script to catch any silent truncation or encoding issue introduced during deployment.

How to fix Error 141 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 141

Why This Error Happens

Error 141 occurs when a single SELECT statement attempts to both assign a value to a variable (using SET or SELECT @variable = column) and return a result set to the client simultaneously. SQL Server’s parser strictly enforces that variable assignment queries must be standalone operations, separate from data-retrieval queries that display rows. This is a T-SQL syntax restriction rather than a configuration or permissions issue, and it typically surfaces after code migrations, ORM-generated queries, or legacy scripts ported to SQL Server 2025.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Check the SQL Server error log or SSMS output pane for the exact line number referenced alongside Error 141.
  • Look for query patterns like SELECT @var = ColumnName, ColumnName2 FROM TableName.
  • Use SQL Server Profiler or Extended Events to capture the exact batch text if the error originates from an application layer rather than a script.

Step 2: Separate Variable Assignment from Data Retrieval

  • Rewrite the query so variable assignment and row output are split into two distinct statements.
  • Example fix:
  -- Incorrect (causes Error 141)
  SELECT @EmployeeName = Name, Department FROM Employees WHERE ID = 1;

  -- Corrected
  SELECT @EmployeeName = Name FROM Employees WHERE ID = 1;
  SELECT Name, Department FROM Employees WHERE ID = 1;
  • If the goal is only to capture a single value, remove the extra columns entirely rather than splitting the query.

Step 3: Audit Stored Procedures and Application Code

  • Search all stored procedures, functions, and triggers using:
  SELECT OBJECT_NAME(object_id), definition
  FROM sys.sql_modules
  WHERE definition LIKE '%SELECT @%FROM%';
  • Update any ORM (Entity Framework, Dapper, etc.) generated queries or dynamic SQL strings that concatenate assignment and retrieval logic.
  • Redeploy the corrected stored procedures using SQL Server Management Studio (SSMS) 21 or Azure Data Studio on Windows Server 2025/Windows 11.

Step 4: Validate T-SQL Compatibility Level

  • Confirm the database compatibility level isn’t forcing legacy parsing behavior by running:
  SELECT compatibility_level FROM sys.databases WHERE name = 'YourDatabaseName';
  • If set below 160 (SQL Server 2022) or the 2025 equivalent, update it with:
  ALTER DATABASE YourDatabaseName SET COMPATIBILITY_LEVEL = 170;

Alternative or Verification Steps

  • Re-run the corrected query/procedure in SSMS and confirm no Error 141 appears in the Messages tab, and that the variable holds the expected single value via PRINT @variable.
  • If the error persists in a third-party application, check for outdated linked-server or driver versions (ODBC/OLE DB) that may be auto-generating non-compliant SELECT syntax, and update the driver to the latest version certified for SQL Server 2025.

How to fix Error 136 on Windows Server 2025 / Windows 11

Troubleshooting Guide: MSSQL Error 136 — “Cannot Use a CONTINUE Statement Outside the Scope of a WHILE Statement”

Why This Error Happens

This error occurs because the T-SQL parser encountered a CONTINUE keyword that is not logically nested inside an active WHILE loop block. This is typically caused by misplaced BEGIN...END blocks, a CONTINUE statement sitting inside an IF condition that is not itself wrapped within the loop, or a copy-paste error where the WHILE declaration was accidentally deleted or commented out. It is a script/syntax-level issue rather than a server configuration or permissions problem.

Step-by-Step Resolution Guide

Step 1: Isolate the Offending Code Block

  • Open the stored procedure, trigger, or script in SQL Server Management Studio (SSMS) referenced in the error message.
  • Locate the exact line number provided in the error output (e.g., “Line 45”).
  • Search specifically for the CONTINUE keyword closest to that line number.

Step 2: Audit the BEGIN/END Nesting Structure

  • Verify that every BEGIN keyword has a corresponding END keyword. A common mistake is an extra END that closes the WHILE loop prematurely, leaving the CONTINUE orphaned in the outer scope.
  • Use the “Edit > Advanced > Format Document” or manual indentation in SSMS to visually align nested blocks.
  • Confirm the WHILE condition exists and precedes the CONTINUE statement in the same logical scope:
  WHILE @Counter < 10
  BEGIN
      IF @Status = 1
      BEGIN
          CONTINUE; -- Ensure this remains inside the WHILE block
      END
  END

Step 3: Check for Accidental Deletion or Syntax Errors

  • Look for missing semicolons or apostrophes above the loop that might cause the parser to misinterpret where the WHILE block terminates.
  • Ensure no GO batch separator was accidentally inserted between the WHILE statement and the CONTINUE statement, as GO resets the batch scope and destroys the loop context.

Step 4: Recompile and Test the Script

  • Highlight only the corrected stored procedure or script block in SSMS.
  • Execute the script using F5 or the “Execute” button to check for a clean compile.
  • Check the “Messages” tab in SSMS to confirm the error code 136 no longer appears.

Alternative or Verification Steps

  • Verification: Run sp_helptext 'YourProcedureName' to view the currently stored definition in the database and confirm the syntax matches your corrected local version before redeploying.
  • Alternative: If the loop logic is complex, replace CONTINUE with a GOTO label pointing to the end of the loop’s logic block, then use standard IF logic to skip to the WHILE condition check manually.

How to fix Error 137 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 137 — “Must Declare the Scalar Variable”

Why This Error Happens

This error occurs when a T-SQL batch or stored procedure references a variable (e.g., @VariableName) that was never declared with a DECLARE statement in the current scope, or whose declaration exists outside the current batch boundary (separated by a GO statement). It is a parsing/compilation-time error, not a permissions or connectivity issue, meaning SQL Server 2025 rejects the query before execution because the variable reference is invalid. This commonly happens after copy-pasting partial scripts, dynamic SQL misuse, or accidentally splitting a script with GO between the DECLARE and its usage.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Variable and Scope

  • Open the query in SSMS (SQL Server Management Studio) or Azure Data Studio connected to your Windows Server 2025 instance.
  • Locate the exact variable name printed in the error message (e.g., @CustomerID).
  • Check whether a GO batch separator exists between the DECLARE @CustomerID ... line and the line where it is used — GO resets variable scope entirely.

Step 2: Verify Variable Declaration Syntax

  • Confirm the variable is declared using correct syntax: DECLARE @CustomerID INT;.
  • Ensure there are no typos in variable names (SQL Server is case-sensitive to spelling, e.g., @CustID vs @CustomerID).
  • If using dynamic SQL via sp_executesql, confirm variables are passed correctly using the parameter definition string, since variables inside a dynamic string execute in a separate scope.

Step 3: Fix Dynamic SQL Parameter Binding

  • If the error originates inside EXEC sp_executesql N'SELECT * FROM Orders WHERE ID = @ID', ensure you supply the parameter definition and value:
  • EXEC sp_executesql N'SELECT * FROM Orders WHERE ID = @ID', N'@ID INT', @ID = @CustomerID;
  • Do not concatenate variables directly into dynamic strings without matching declarations inside that string’s scope.

Step 4: Rebuild and Re-Run the Script

  • Remove any unnecessary GO statements that break the batch improperly.
  • Re-run the corrected script in a fresh query window to avoid cached execution plans triggering stale errors.
  • Save the corrected script and re-deploy it to any linked SQL Agent Jobs or stored procedures on the Windows Server 2025 instance.

Alternative or Verification Steps

  • Verify the fix by executing the script in isolation (highlight only the relevant DECLARE and query block) to confirm no Error 137 appears in the Messages tab.
  • If the error persists in a stored procedure, use sp_helptext 'ProcedureName' to review the full definition and confirm all variables are declared before use within the same CREATE PROCEDURE batch.

How to fix Error 138 on Windows Server 2025 / Windows 11

Why This Error Happens

Error 138 occurs when a T-SQL statement contains a subquery that references a column from the outer query (a correlation) in a context where SQL Server’s query optimizer does not support correlation—such as inside certain CHECK constraints, computed column definitions, or specific derived table structures. This is a syntax/design limitation rather than a permissions or connectivity issue, meaning the query itself must be restructured. It commonly surfaces after migrating legacy T-SQL scripts to SQL Server 2025, where stricter parsing rules expose previously tolerated (but technically invalid) correlated logic.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Subquery

  • Open the query in SQL Server Management Studio (SSMS) connected to your Windows Server 2025 instance and locate the exact line number referenced in the error message.
  • Check whether the subquery is embedded inside a CHECK CONSTRAINT, a computed column, or a WHERE clause using a correlated column that isn’t permitted in that scope.
  • Run the query in isolation (just the subquery) to confirm it depends on an outer table alias.

Step 2: Rewrite the Subquery as a Join or CTE

  • Convert the correlated subquery into an explicit INNER JOIN or LEFT JOIN against the outer table, using matching keys instead of a correlation clause.
  • Alternatively, use a Common Table Expression (CTE) with WITH to pre-aggregate or pre-filter the data before joining it back to the main query.
  • Example: Replace WHERE EXISTS (SELECT 1 FROM Orders O WHERE O.CustomerID = C.CustomerID AND O.Total > 100) with a JOIN on Orders O ON O.CustomerID = C.CustomerID plus a WHERE O.Total > 100 filter.

Step 3: Validate Constraint and Computed Column Definitions

  • If the error originates from a CHECK constraint or computed column, open the table definition via sp_helpconstraint 'TableName' in SSMS.
  • Drop and recreate the constraint using a scalar function (CREATE FUNCTION) instead of an inline correlated subquery, since constraints cannot reference outer query context directly.
  • Deploy the corrected schema using SQLCMD or the SSMS query window: sqlcmd -S localhost -d YourDB -i FixConstraint.sql.

Step 4: Update Compatibility Level (If Migrating Legacy Code)

  • Navigate to Database Properties > Options > Compatibility Level in SSMS and confirm it matches SQL Server 2025 (160).
  • If older compatibility levels mask this issue inconsistently, test the query under compatibility level 160 explicitly using ALTER DATABASE YourDB SET COMPATIBILITY_LEVEL = 160;.

Alternative or Verification Steps

  • Re-run the corrected query in SSMS and confirm it executes without Error 138, then check the Actual Execution Plan to ensure the join/CTE performs efficiently.
  • If rewriting as a JOIN is not feasible due to complex logic, use CROSS APPLY or OUTER APPLY instead, as these support row-by-row correlation legally, unlike the original subquery structure.

How to fix Error 132 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 132 – Duplicate Label Declaration in SQL Server 2025

Why This Error Happens

Error 132 occurs when the T-SQL parser encounters the same label name declared more than once within a single query batch, stored procedure, function, or trigger. This is a script-level syntax issue rather than a server configuration problem — it typically arises from copy-pasted code blocks, nested loops using identical GOTO labels, or merged scripts that were not properly refactored. SQL Server enforces label uniqueness per batch scope, so even labels inside different BEGIN...END blocks within the same batch will trigger this conflict if they share a name.

Step-by-Step Resolution Guide

Step 1: Locate the Duplicate Label in the Script

  • Open the stored procedure or query batch referenced in the error message using SQL Server Management Studio (SSMS) or Azure Data Studio.
  • Use Ctrl+F to search for the exact label name shown in the error text (e.g., ErrorHandler:, Retry:, or Loop1:).
  • Note every line number where that label appears — Error 132 confirms it exists at least twice.

Step 2: Rename or Consolidate the Conflicting Labels

  • If the labels serve different logical purposes, rename the second occurrence to something unique, such as Retry_Insert: and Retry_Update:.
  • If the labels were duplicated accidentally (e.g., from copy-pasted TRY...CATCH or GOTO logic), delete the redundant label and repoint any GOTO statements to the correct single label.
  • Ensure the label still logically sits at the correct execution point in the script after renaming.

Step 3: Validate Batch Separation

  • Check whether the script should be split using GO batch separators — labels are scoped per batch, so adding a GO statement between logical sections can also resolve unintended overlap.
  • Confirm that dynamic SQL blocks executed via sp_executesql or EXEC() do not redeclare the same label used in the outer batch.

Step 4: Recompile and Test the Procedure

  • Run ALTER PROCEDURE (or CREATE OR ALTER PROCEDURE) to recompile the corrected object.
  • Execute the procedure in a test environment (non-production instance on Windows Server 2025) to confirm the parser no longer throws Error 132.

Alternative or Verification Steps

  • Run sys.sp_helptext '<ProcedureName>' in SSMS to review the final compiled definition and confirm no duplicate labels remain.
  • If the error persists after renaming, check for hidden characters or encoding issues in the script file by re-typing the label manually instead of pasting it, then re-deploy.

How to fix Error 133 on Windows Server 2025 / Windows 11

Why This Error Happens

Error 133 occurs when the T-SQL parser encounters a GOTO statement pointing to a label that does not exist anywhere in the current batch, stored procedure, or script scope. This is typically caused by a typo in the label name, a label that was accidentally deleted or commented out during code edits, or a GOTO call that references a label defined in a different batch (separated by a GO statement), since labels do not carry over across batch boundaries. It is a purely logical/syntax issue within the script rather than a server configuration or permissions problem.

Step-by-Step Resolution Guide

Step 1: Locate the Offending GOTO Statement

  • Open the script or stored procedure definition in SQL Server Management Studio (SSMS) on your Windows Server 2025 / Windows 11 host.
  • Use Ctrl+F to search for the exact GOTO keyword and note the label name reported in the error message (the %.*ls placeholder will be replaced with the actual label name at runtime).

Step 2: Verify Label Declaration and Spelling

  • Search the same script for a line ending in : that matches the label name exactly (labels are case-insensitive but must match character-for-character, including underscores).
  • Confirm there are no extra spaces, hidden characters, or trailing colons causing a mismatch, e.g. MyLabel: vs My_Label:.
  • Correct any typos so the GOTO LabelName statement and the LabelName: declaration match precisely.

Step 3: Check for Batch Separation Issues

  • Ensure the GOTO statement and its target label exist within the same batch — scroll through the script for any GO statements that might split the label from its reference.
  • If a GO separator is found between the GOTO call and the label, remove the unnecessary GO or restructure the logic so both reside in the same batch.

Step 4: Rebuild or Redeploy the Stored Procedure

  • If the procedure was altered via source control or a deployment pipeline, redeploy the corrected script using sqlcmd or SSMS to ensure the compiled object reflects your fix:
  • sqlcmd -S localhost -d YourDatabase -i FixedScript.sql
  • Recompile the object with EXEC sp_recompile 'YourProcedureName'; to clear any cached execution plans referencing the old code.

Alternative or Verification Steps

  • Run the corrected script or execute the stored procedure directly in SSMS (EXEC YourProcedureName;) and confirm it completes without raising Error 133.
  • If the error persists, use sys.sql_modules to pull the live definition (SELECT definition FROM sys.sql_modules WHERE object_id = OBJECT_ID('YourProcedureName')) and diff it against your local script to catch any deployment drift or missed edits.

How to fix Error 134 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 134 – “The variable name ‘%.*ls’ has already been declared”

Why This Error Happens

This error occurs when a T-SQL script or stored procedure attempts to declare the same variable name more than once within the same batch or procedure scope. SQL Server enforces variable name uniqueness per batch because it compiles and allocates memory for variables at parse time, and duplicate declarations create an ambiguous reference. This is typically caused by copy-pasted code blocks, merged scripts without proper cleanup, or missing GO batch separators between logical sections that each declare the same variable.

Step-by-Step Resolution Guide

Step 1: Identify the Duplicate Declaration

  • Open the script or stored procedure referenced in the error message.
  • Search for all instances of DECLARE @VariableName using Ctrl+F in SQL Server Management Studio (SSMS).
  • Note the exact variable name shown in the error output (it replaces the %.*ls placeholder in the actual error message).

Step 2: Remove or Consolidate Redundant DECLARE Statements

  • If the same variable is declared twice with the same data type, delete the second DECLARE statement entirely.
  • If the variable is needed for a different purpose in a later section, rename it (e.g., @UserID to @UserID2) to avoid scope collision.
  • For merged scripts, check for leftover DECLARE @Counter INT or @ErrorMessage NVARCHAR lines that were duplicated during copy-paste operations.

Step 3: Insert Proper Batch Separators

  • If the variables are genuinely meant to be reused across independent logical sections, insert a GO statement between them to force SQL Server to treat them as separate batches.
  • Example:
  DECLARE @Total INT = 0;
  SELECT @Total = COUNT(*) FROM Sales;
  GO
  DECLARE @Total INT = 0; -- Now valid, new batch
  • Note that variables declared before a GO will not persist into the next batch, so ensure logic doesn’t depend on cross-batch variable values.

Step 4: Validate Stored Procedure Structure

  • If the error originates inside a stored procedure (not a raw script), open the procedure definition via sp_helptext 'ProcedureName' in SSMS.
  • Confirm that no DECLARE statement is repeated within the single procedure body, since GO batch separators are not valid inside a single stored procedure.
  • Recompile the procedure after edits using ALTER PROCEDURE to apply the corrected script.

Alternative or Verification Steps

  • Run the corrected script in a new SSMS query window and confirm it executes without Error 134; check the Messages tab for a clean “Command(s) completed successfully” output.
  • If the error persists in a large script, use SET PARSEONLY ON; before execution to validate syntax and variable scope without actually running the queries, then toggle it back to OFF.

How to fix Error 135 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 135 – “Cannot use a BREAK statement outside the scope of a WHILE statement”

Why This Error Happens

This error occurs when the SQL Server parser encounters a BREAK keyword that is not nested inside an active WHILE loop block. It is typically caused by mismatched BEGIN...END blocks, a BREAK statement accidentally placed inside an IF condition or CASE expression that sits outside the loop, or leftover code from a copy-paste edit that removed the enclosing WHILE statement. This is a T-SQL syntax/logic issue rather than a server configuration or permissions problem.

Step-by-Step Resolution Guide

Step 1: Isolate the Offending Code Block

  • Open the stored procedure, trigger, or script referenced in the error message inside SQL Server Management Studio (SSMS) 21 or Azure Data Studio.
  • Use Ctrl+F to search for every instance of the BREAK keyword in the batch.
  • Note the line number returned in the error dialog (SSMS displays this in the “Messages” tab).

Step 2: Validate BEGIN…END Nesting

  • Manually trace each BEGIN to its corresponding END to ensure the BREAK sits within the same scope as an active WHILE loop.
  • Check for a missing BEGIN immediately after the WHILE (condition) line — without it, only the next single statement belongs to the loop, and any subsequent BREAK falls outside scope.
  • Use SSMS’s built-in “Format SQL” feature (or a tool like Poor Man’s T-SQL Formatter) to auto-indent the script; misaligned indentation usually reveals broken nesting instantly.

Step 3: Correct the Loop Structure

  • Rewrite the block so BREAK is placed directly inside the WHILE (...) BEGIN ... END construct, for example:
  WHILE (@Counter < 10)
  BEGIN
      IF (@Counter = 5)
          BREAK;
      SET @Counter = @Counter + 1;
  END
  • If the BREAK was intended to exit an IF block only (not a loop), replace it with a RETURN, GOTO, or restructure the conditional logic instead of using BREAK.

Step 4: Recompile and Test the Object

  • Execute ALTER PROCEDURE (or CREATE OR ALTER PROCEDURE) to recompile the corrected object.
  • Run the procedure with test parameters in a non-production database to confirm Error 135 no longer appears.
  • Check sys.messages for the message ID 135 to confirm current SQL Server 2025 wording matches what you’re troubleshooting, in case of localization differences.

Alternative or Verification Steps

  • Run SET PARSEONLY ON; followed by the script batch in SSMS — this validates syntax without execution and will immediately confirm whether the BREAK/WHILE scoping issue is resolved.
  • If the error persists in a large procedure, temporarily comment out sections using /* */ block comments to bisect the code and isolate exactly which nested block contains the scope violation.

How to fix Error 130 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 130 – Cannot Perform an Aggregate Function on an Expression Containing an Aggregate or a Subquery

Why This Error Happens

This error occurs because SQL Server’s query engine does not allow nesting one aggregate function (like SUM, AVG, COUNT) directly inside another aggregate function, or applying an aggregate directly to the result of a subquery within the same SELECT level. This is a T-SQL syntax and logical processing limitation, not a permissions or connectivity issue. It typically surfaces after a query is migrated, auto-generated by an ORM, or edited to include nested calculations such as SUM(AVG(column)) or SUM((SELECT COUNT(*) FROM table)) without an intermediate derived table.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and locate the exact query referenced in the SQL Server error log or application stack trace.
  • Look specifically for patterns like SUM(COUNT(x)), AVG(SUM(x)), or an aggregate wrapped around a scalar subquery.
  • Check C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG on Windows Server 2025 to confirm the exact statement text if it was logged.

Step 2: Refactor Using a Derived Table or CTE

  • Break the nested aggregation into two separate steps by first calculating the inner aggregate in a subquery or Common Table Expression (CTE).
  • Example fix:
  WITH InnerAgg AS (
      SELECT CustomerID, COUNT(OrderID) AS OrderCount
      FROM Orders
      GROUP BY CustomerID
  )
  SELECT AVG(OrderCount) AS AvgOrdersPerCustomer
  FROM InnerAgg;
  • Apply the outer aggregate (AVG, SUM, etc.) only to the column returned by the derived table, never directly to another aggregate function.

Step 3: Validate Subquery Placement

  • If the error originates from a subquery (not nested aggregates), move the subquery into the FROM clause as a derived table rather than placing it inside the aggregate function’s parentheses.
  • Ensure any correlated subquery used for aggregation is isolated using OUTER APPLY or a JOIN against a pre-aggregated result set.
  • Re-run the query in SSMS with Include Actual Execution Plan enabled to confirm the parser accepts the new structure without throwing Error 130.

Step 4: Update Application-Side Query Generators

  • If the query is auto-generated by an ORM (Entity Framework, Hibernate, etc.) running on Windows 11 or Windows Server 2025, check the LINQ or HQL statement causing the nested aggregation.
  • Modify the application code to force materialization of the inner aggregate (e.g., using .ToList() in Entity Framework before applying the outer aggregate) so SQL Server generates two separate SELECT statements instead of one nested call.

Alternative or Verification Steps

  • Run the corrected query directly in SSMS against a test database; a successful result set with no red error banner confirms the fix.
  • If the error persists, use SET SHOWPLAN_TEXT ON before executing the query to inspect how SQL Server is parsing the aggregate logic and identify any remaining nested function calls.

How to fix Error 131 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 131 – Size Exceeds Maximum Allowed for Data Type

Why This Error Happens

Error 131 occurs when a T-SQL statement attempts to declare or cast a column, variable, or parameter with a length that exceeds the maximum limit permitted for that specific data type (for example, exceeding nvarchar(4000) when Unicode byte-doubling pushes it past the 8,000-byte limit, or exceeding 8,000 bytes for varchar/binary outside of MAX types). This is typically caused by a coding error in dynamic SQL, a misconfigured ORM/schema migration script, or a manually written query that miscalculates byte length versus character length. It can also surface after an application upgrade where a linked system now passes larger string payloads than the underlying schema was designed to accept.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement

  • Capture the exact query using SQL Server Profiler, Extended Events, or the Activity Monitor to find the failing batch.
  • Check the error message text closely — it will report the exact size (%d) requested and the maximum allowed (%d), which tells you if it’s a varchar, nvarchar, binary, or varbinary mismatch.
  • Look in application logs (Event Viewer > Applications and Services Logs > MSSQLSERVER) for the correlated timestamp and query context.

Step 2: Correct the Data Type Declaration

  • Open the stored procedure, function, or dynamic SQL script referenced in the error.
  • For character types, ensure lengths do not exceed:
  • varchar/char: 8,000 bytes
  • nvarchar/nchar: 4,000 characters (8,000 bytes)
  • varbinary/binary: 8,000 bytes
  • If larger storage is genuinely required, switch the column or variable definition to a MAX type, e.g., VARCHAR(MAX), NVARCHAR(MAX), or VARBINARY(MAX).
  • Update the CREATE TABLE, ALTER TABLE, or DECLARE statement accordingly:
  ALTER TABLE dbo.YourTable
  ALTER COLUMN YourColumn NVARCHAR(MAX);

Step 3: Audit Dynamic SQL and ORM-Generated Scripts

  • If the error originates from an ORM (Entity Framework, Hibernate, etc.) or a schema migration tool, review the generated DDL/DML for hardcoded oversized length parameters.
  • Correct the model/mapping definitions to align with SQL Server’s maximum allowed sizes before regenerating migration scripts.
  • Re-run the corrected script in a non-production environment first to confirm the schema change compiles without triggering Error 131.

Step 4: Apply and Test the Fix

  • Deploy the corrected script to a staging environment on Windows Server 2025 or Windows 11 test instance running SQL Server 2025.
  • Execute the previously failing query or application workflow to confirm Error 131 no longer appears.
  • Monitor SQL Server error logs at C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG for recurrence.

Alternative or Verification Steps

  • Run sys.dm_exec_query_stats or re-execute the corrected query directly in SQL Server Management Studio (SSMS) to confirm it completes without throwing Error 131.
  • If the issue persists after switching to MAX types, check for downstream triggers, computed columns, or replication/CDC schemas that may still reference the old fixed-length definition and require separate updates.

How to fix Error 126 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 126 – “Invalid pseudocolumn”

Why This Error Happens

This error occurs when a Transact-SQL query references a pseudocolumn name (such as $IDENTITY, $ROWGUID, or $PARTITION) that does not exist on the target table or is spelled incorrectly, often due to a typo or an incompatible object type. It can also happen when a query is copied from a different schema or version of SQL Server 2025 where the underlying table structure (e.g., missing an IDENTITY column or ROWGUIDCOL property) does not support the pseudocolumn being called. Additionally, this can surface after a database migration to Windows Server 2025 where compatibility levels were reset, causing legacy syntax to fail validation.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query and Pseudocolumn

  • Open SQL Server Management Studio (SSMS) and check the exact error message for the pseudocolumn name reported (e.g., $IDENTITY).
  • Locate the specific stored procedure, view, or ad-hoc query using the SQL Server Profiler or Extended Events session to capture the exact statement text.
  • Cross-reference the pseudocolumn name against the official list: $IDENTITY, $ROWGUID, and $PARTITION.

Step 2: Verify Table Schema and Column Properties

  • Run sp_help 'YourTableName' in the query window to inspect the table definition.
  • Confirm that an IDENTITY property exists on a column if $IDENTITY is being referenced.
  • Confirm a uniqueidentifier column has the ROWGUIDCOL property set if $ROWGUID is being used.
  • If the property is missing, alter the table:
  ALTER TABLE YourTableName
  ADD RowGUIDCol UNIQUEIDENTIFIER ROWGUIDCOL DEFAULT NEWID();

Step 3: Correct the Query Syntax

  • Edit the query in SSMS and replace the invalid pseudocolumn reference with the correct column name or a valid pseudocolumn.
  • For partitioned tables, ensure $PARTITION is followed by a valid partition function name in the correct syntax: $PARTITION.PartitionFunctionName(column).
  • Save the corrected script and re-deploy any associated stored procedures or views using sqlcmd or SSMS deployment.

Step 4: Check Database Compatibility Level

  • On Windows Server 2025, open a new query window and run:
  SELECT compatibility_level FROM sys.databases WHERE name = 'YourDatabaseName';
  • If the compatibility level is outdated or mismatched with SQL Server 2025 features, update it:
  ALTER DATABASE YourDatabaseName SET COMPATIBILITY_LEVEL = 170;

Step 5: Rebuild Dependent Objects

  • Use sp_refreshview for any views referencing the corrected table.
  • Recompile stored procedures with EXEC sp_recompile 'YourProcedureName'; to clear any cached invalid execution plans.

Alternative or Verification Steps

  • Re-run the original query or execute the stored procedure manually in SSMS to confirm Error 126 no longer appears in the Messages tab.
  • If the issue persists, restore a known-good backup of the schema on a test instance in Windows 11 and compare column definitions side-by-side using sys.columns to spot missing pseudocolumn-supporting properties.

How to fix Error 127 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 127 — “A TOP N or FETCH rowcount value may not be negative”

Why This Error Happens

This error occurs when a Transact-SQL query uses a TOP (N) clause or an OFFSET/FETCH NEXT clause where the value supplied for N (or the rowcount) evaluates to a negative integer at runtime. This is typically caused by a variable, parameter, subquery, or calculated expression that resolves to a negative number instead of a non-negative integer as SQL Server 2025 requires. It is not a server configuration or permissions issue — it is strictly a data validation/logic problem within the query, stored procedure, or application code generating the SQL statement.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query and Variable

  • Capture the exact query using SQL Server Profiler, Extended Events, or the Query Store in SSMS (Object Explorer > Databases > [YourDB] > Query Store > Top Resource Consuming Queries).
  • Look specifically for TOP (@Variable), FETCH NEXT @RowCount ROWS ONLY, or OFFSET @Offset ROWS in the captured batch.
  • Note the source of the variable — is it a stored procedure parameter, a calculated value, or passed directly from the application layer (e.g., C#, Python, PowerShell)?

Step 2: Add Explicit Validation Logic

  • Open the stored procedure or script in SQL Server Management Studio (SSMS) 21 or Azure Data Studio.
  • Insert a guard clause immediately before the TOP or FETCH statement to sanitize the value:
IF @RowCount < 0
    SET @RowCount = 0;
  • For dynamic SQL, ensure the value is cast and validated as INT and non-negative before concatenation:
SET @RowCount = ABS(ISNULL(@RowCount, 0));

Step 3: Correct the Application-Side Logic

  • Check the application code or API layer supplying the value (common with pagination logic using page_number * page_size calculations that can go negative on the first page or with malformed input).
  • Ensure pagination logic never subtracts below zero, e.g., in C#:
int offset = Math.Max(0, (pageNumber - 1) * pageSize);
  • Redeploy the updated application binary or script to the Windows Server 2025 / Windows 11 host and restart the associated application pool or service.

Step 4: Test in Isolation

  • Run the corrected query directly in SSMS with a hardcoded negative test value replaced by the sanitized variable to confirm the guard clause intercepts it.
  • Check the SQL Server Error Log (via EXEC sp_readerrorlog or SQL Server Configuration Manager > Logs) to confirm Error 127 no longer appears after the fix is deployed.

Alternative or Verification Steps

  • Re-run the original failing transaction or application workflow end-to-end and confirm no Error 127 appears in the SQL Server Error Log or Windows Event Viewer (Application log, Source: MSSQLSERVER).
  • If the error persists, use sp_helptext on the affected stored procedure to check for nested calls or triggers that may also pass unvalidated rowcount values to a TOP/FETCH clause further down the call stack.

How to fix Error 128 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 128 — “The name is not permitted in this context”

Why This Error Happens

This error occurs when SQL Server’s query parser encounters a column name, variable, or identifier in a context where only constants, literals, or specific expressions are allowed—most commonly inside a DEFAULT constraint, a computed column definition, or a CHECK constraint referencing a non-deterministic or invalid expression. It also frequently arises when a subquery or column reference is mistakenly placed inside a GROUP BY, ORDER BY positional expression, or a CASE statement where SQL Server expects a static value instead of a dynamic reference. Essentially, the parser is telling you that the expression you supplied cannot be resolved at the point in execution where a constant is required, often due to scoping or evaluation-order issues in T-SQL.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement and Line

  • Open the exact query or stored procedure referenced in the SQL Server error log or SSMS error output (the %.*s placeholder will be replaced with the actual name in your real error message).
  • Use SSMS > Query > Include Actual Execution Plan or simply re-run the isolated statement to pinpoint which clause triggers Error 128.
  • Check if the issue occurs in a DEFAULT, CHECK, computed column, or GROUP BY/ORDER BY clause.

Step 2: Correct the Expression Context

  • If the error is in a DEFAULT constraint, replace any column reference with a literal constant or a deterministic system function (e.g., GETDATE(), 0, 'N/A') — column names are never valid here.
  • If the error is in a computed column, ensure you are not referencing another computed column that itself relies on non-deterministic logic; rewrite using base table columns only.
  • If the error is in GROUP BY or ORDER BY, replace ordinal/positional references with explicit column names or valid expressions.

Step 3: Rebuild or Alter the Schema Object

  • Run ALTER TABLE [YourTable] DROP CONSTRAINT [ConstraintName]; to remove the faulty constraint.
  • Recreate it with corrected syntax: ALTER TABLE [YourTable] ADD CONSTRAINT [ConstraintName] DEFAULT ('ValidConstant') FOR [ColumnName];
  • For stored procedures or views, use CREATE OR ALTER PROCEDURE/VIEW after fixing the invalid expression in SSMS.

Step 4: Validate Compatibility Level Settings

  • On Windows Server 2025 / SQL Server 2025, confirm the database compatibility level isn’t causing older syntax to be misinterpreted: run SELECT compatibility_level FROM sys.databases WHERE name = 'YourDB';
  • If needed, update it: ALTER DATABASE [YourDB] SET COMPATIBILITY_LEVEL = 170;
  • Restart the SQL Server service via services.msc or Restart-Service MSSQLSERVER in PowerShell (run as Administrator) to apply changes cleanly.

Alternative or Verification Steps

  • Re-execute the original query or trigger the stored procedure/application workflow that previously failed; confirm no Error 128 appears in SQL Server Management Studio or the Windows Event Viewer (Application Log).
  • If the error persists, use sp_helptext '[ObjectName]' to dump the full object definition and manually audit every DEFAULT, CHECK, and computed column for embedded non-constant expressions.

How to fix Error 129 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 129 – Invalid Fillfactor Percentage

Why This Error Happens

Error 129 occurs when a FILLFACTOR value specified in a CREATE INDEX, ALTER INDEX, or server configuration statement falls outside the valid range of 1 to 100. This is typically caused by a scripting error, a hardcoded value passed incorrectly from an application variable, or a misconfigured maintenance script that calculates fillfactor dynamically and returns an out-of-bounds integer (such as 0, a negative number, or a value greater than 100). It can also surface during automated index rebuild jobs where a corrupted configuration table or a legacy script references deprecated or malformed fillfactor values.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement or Script

  • Check the SQL Server Error Log (via SSMS or xp_readerrorlog) to locate the exact query or job that triggered Error 129.
  • Review any maintenance plans, SQL Agent Jobs, or Ola Hallengren index optimization scripts that dynamically calculate fillfactor.
  • Search T-SQL scripts for WITH (FILLFACTOR = ...) clauses to find hardcoded or variable-driven values.

Step 2: Correct the Fillfactor Value in the Script

  • Update the script to ensure the fillfactor value is explicitly set between 1 and 100 (e.g., WITH (FILLFACTOR = 90)).
  • If the value is generated dynamically (e.g., from a variable @FillFactorValue), add validation logic:
  IF @FillFactorValue < 1 OR @FillFactorValue > 100
      SET @FillFactorValue = 90; -- fallback default
  • Avoid setting fillfactor to 0 unless intentionally using SQL Server’s default behavior, which is different from an invalid percentage.

Step 3: Validate Server-Level Fillfactor Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Navigate to Server Properties > Database Settings and confirm the Default Index Fill Factor field shows a valid value (1–100).
  • Alternatively, run the following T-SQL to check and reset the server-wide default:
  EXEC sp_configure 'fill factor', 90;
  RECONFIGURE WITH OVERRIDE;

Step 4: Re-run the Index Operation

  • After correcting the value, re-execute the CREATE INDEX or ALTER INDEX statement manually to confirm the error no longer appears.
  • If running via SQL Server Agent, manually start the job step in isolation to confirm success before re-enabling the full schedule.

Alternative or Verification Steps

  • Run SELECT name, fill_factor FROM sys.indexes WHERE fill_factor <> 0; to confirm all indexes on the affected database now show valid fillfactor values.
  • If the error persists in an automated job, temporarily hardcode FILLFACTOR = 100 in the script to isolate whether the issue is with dynamic calculation logic versus a deeper configuration/corruption issue.

How to fix Error 123 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 123 – Batch/Procedure Exceeds Maximum Length

Why This Error Happens

This error occurs because SQL Server 2025 enforces a hard-coded parser limit on the maximum size of a single batch (typically 65,536 * network packet size, but effectively capped by the tokenized batch size limit). It is most commonly triggered when a large auto-generated script—such as an ORM-generated INSERT statement, a bulk migration script, or a poorly optimized dynamic SQL block—is sent as a single unbroken batch without GO separators. Corrupted or malformed script files that fail to render batch separators correctly during export/import can also cause the parser to read multiple logical batches as one massive continuous string.

Step-by-Step Resolution Guide

Step 1: Identify and Isolate the Offending Batch

  • Open the script in SQL Server Management Studio (SSMS) or Azure Data Studio and check the file size; scripts exceeding 8-10 MB in a single batch are high-risk candidates.
  • Use Ctrl+F to search for missing GO statements between logical sections (e.g., between multiple INSERT or CREATE statements).
  • If using sqlcmd, run the script with the -r flag to capture verbose error output pinpointing the exact line number.

Step 2: Insert Batch Separators (GO Statements)

  • Manually insert GO keywords every 1,000–5,000 lines or after every logical unit of work (e.g., after each stored procedure definition or every 500 INSERT rows).
  • For bulk data scripts, wrap INSERT statements in batches of 1,000 rows using GO after each block:
  INSERT INTO dbo.Table1 VALUES (...);
  GO
  • If the script is auto-generated (e.g., via SSMS “Generate Scripts” wizard), navigate to Advanced Options > Types of data to script and ensure “Script Batch Size” is enabled.

Step 3: Adjust Network Packet Size (If Applicable)

  • Open SQL Server Configuration Manager on Windows Server 2025.
  • Navigate to SQL Server Network Configuration > Protocols for [Instance Name].
  • While this does not raise the hard batch character limit, increasing the Network Packet Size (default 4096 bytes) in Server Properties > Advanced can help with related transmission errors bundled with Error 123 in large data transfers.
  • Restart the SQL Server service via services.msc or Restart-Service MSSQLSERVER in PowerShell (Run as Administrator) for changes to take effect.

Step 4: Use SQLCMD or PowerShell for Large Script Execution

  • Instead of running massive scripts directly in the SSMS query window (which has a lower editor buffer limit), execute them via command line:
  sqlcmd -S ServerName -d DatabaseName -i "C:\Scripts\LargeScript.sql" -E
  • This bypasses some GUI-imposed constraints and processes GO separators natively.

Alternative or Verification Steps

  • Verify the fix: Re-run the script using sqlcmd or SSMS after inserting GO statements; a successful execution with no Error 123 in the Messages tab confirms resolution.
  • Alternative solution: If manually editing GO statements is impractical for extremely large auto-generated files, use a text-processing tool (e.g., PowerShell script or sed on WSL) to programmatically insert GO; every N lines before execution.

How to fix Error 124 on Windows Server 2025 / Windows 11

Why This Error Happens

Error 124 occurs when SQL Server 2025 parses a CREATE PROCEDURE statement but finds no executable T-SQL body between the procedure declaration and the terminating batch separator. This typically happens due to a misplaced GO statement, an empty procedure body left in during development, or a templating/deployment script that stripped the body content during a build pipeline. Corrupted deployment artifacts (e.g., from a broken CI/CD export) can also produce this by truncating the script mid-generation.

Step-by-Step Resolution Guide

Step 1: Inspect the Procedure Definition

  • Open the failing script in SQL Server Management Studio (SSMS) or Azure Data Studio.
  • Check for an accidental GO batch separator placed immediately after the CREATE PROCEDURE ... AS line.
  • Confirm there is at least one valid statement (e.g., SELECT, BEGIN...END, RETURN) between AS and the next GO.

Step 2: Validate the Script Source (Deployment/CI Pipeline)

  • If the script was generated by a DevOps pipeline (Azure DevOps, GitHub Actions), re-export the object using SSMS’s “Generate Scripts” wizard to rule out truncation.
  • Check pipeline logs for incomplete file writes, especially if scripts are stored in C:\DeploymentScripts\SQL\ or a similar mapped network path on Windows Server 2025.
  • Compare file size/hash of the deployed .sql file against the source repository version to detect corruption.

Step 3: Rebuild and Re-run the Procedure Manually

  • Manually rewrite the procedure with a minimal valid body to confirm compilation succeeds:
  CREATE PROCEDURE dbo.TestProc
  AS
  BEGIN
      SELECT 1;
  END
  GO
  • Execute the corrected script in a query window connected to the target instance.
  • If using SQLCMD via PowerShell on Windows 11, run:
  sqlcmd -S localhost -d YourDB -i "C:\Scripts\FixedProc.sql"

Step 4: Check for Encoding/Line-Ending Corruption

  • Open the .sql file in a plain text editor (Notepad++, VS Code) and verify there are no invisible null characters or BOM issues causing the parser to misread the batch.
  • Re-save the file as UTF-8 without BOM and re-run the deployment.

Alternative or Verification Steps

  • Verify the fix by running EXEC sp_helptext 'dbo.YourProcName'; to confirm the stored body matches expectations and compiles without Error 124.
  • If the error persists in automated deployments only, bypass the pipeline temporarily and deploy the script directly via SSMS to isolate whether the issue is in the T-SQL file itself or the deployment tooling.

How to fix Error 125 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 125 – “Case Expressions May Only Be Nested to Level %d”

Why This Error Happens

This error occurs because Transact-SQL enforces a hard limit of 10 nesting levels for CASE expressions within a single query. When a query contains a CASE statement nested inside another CASE statement beyond this threshold, the SQL Server query parser rejects the batch during the compilation phase. This is not caused by corruption or permissions but by a query design that has exceeded the engine’s built-in complexity ceiling, often the result of auto-generated SQL from ORM tools or deeply layered conditional reporting logic.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Use SQL Server Profiler or Extended Events on the Windows Server 2025 instance to capture the exact batch text triggering Error 125.
  • Check the application logs or the SSMS “Messages” tab to isolate the specific stored procedure or ad-hoc script.
  • Look specifically for CASE WHEN ... THEN (CASE WHEN ...) patterns stacked more than 10 levels deep.

Step 2: Refactor Nested Logic into Sequential Steps

  • Break the single massive CASE expression into multiple smaller CASE statements calculated in separate steps.
  • Utilize Common Table Expressions (CTEs) to pre-calculate lower-level conditions before they reach the outer query.
  • Example pattern: Move the innermost 5 levels of logic into a WITH CTE_PreCalc AS (...) block, then reference the CTE’s output column in the remaining outer CASE statement.

Step 3: Replace Complex Logic with a User-Defined Function (UDF)

  • For extremely complex business logic (e.g., tax bracket calculations or multi-tier pricing), migrate the nested CASE logic into a Scalar UDF or an Inline Table-Valued Function (iTVF).
  • Navigate to your Database > Programmability > Functions in SSMS to create the new object.
  • Update the original query to call dbo.fn_YourNewFunction(@param) instead of the inline nested CASE block.

Step 4: Validate Query Syntax in a Test Environment

  • Before deploying to production on Windows Server 2025, run the refactored query in a Dev/Test instance of SQL Server 2025.
  • Ensure the compatibility level of the database (found via sp_dbcmpat or Database Properties) is not artificially restricting other T-SQL functionalities you might use as a workaround (like IIF or CHOOSE).

Alternative or Verification Steps

  • Verification: Execute the modified script using SET NOEXEC ON; GO followed by the query to check for compilation errors without actually running the data retrieval, ensuring the parser passes without throwing Error 125.
  • Alternative: If refactoring is not immediately feasible, consider using the IIF() or CHOOSE() T-SQL functions as a shorthand replacement for simple binary CASE logic, as they can sometimes reduce the total nesting depth count required by the parser.

How to fix Error 120 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 120 – Column Mismatch in INSERT Statement

Why This Error Happens

Error 120 occurs when the number of columns specified in the INSERT INTO column list does not match the number of values or columns returned by the corresponding SELECT statement. This is a syntax-level validation error thrown by the SQL Server query parser/compiler before execution begins, meaning the query plan is never generated. It commonly arises after schema changes (such as adding or dropping a column) when application code or stored procedures are not updated to reflect the new table structure.

Step-by-Step Resolution Guide

Step 1: Review the Exact INSERT and SELECT Statement

  • Open the failing query in SQL Server Management Studio (SSMS) or Azure Data Studio.
  • Manually count the columns listed in the INSERT INTO TableName (Col1, Col2, Col3...) clause.
  • Manually count the columns/values returned by the SELECT clause or VALUES clause.
  • Confirm both counts match exactly, including any computed or literal columns.

Step 2: Validate Source and Target Table Schemas

  • Run EXEC sp_help 'TableName'; on both the source and destination tables to inspect current column definitions.
  • Check for recent schema changes using:
  SELECT COLUMN_NAME, ORDINAL_POSITION 
  FROM INFORMATION_SCHEMA.COLUMNS 
  WHERE TABLE_NAME = 'TableName';
  • Identify if a column was recently added, dropped, or renamed that the query does not account for.

Step 3: Correct the Column Mapping in the Query

  • Explicitly list every column name in both the INSERT INTO and SELECT clauses instead of relying on SELECT *.
  • Add placeholder values (e.g., NULL, DEFAULT, or a static value) for any missing columns to align the count.
  • Save the corrected script and re-run it in a test environment before deploying to production.

Step 4: Check for Trailing Commas or Concatenation Errors

  • Inspect the query for accidental trailing commas that may cause the parser to miscount columns.
  • If the query is dynamically generated (via application code, ORM, or dynamic SQL in a stored procedure), print the generated SQL string using PRINT @SQLString; before execution to visually confirm column alignment.

Step 5: Update Dependent Stored Procedures or Views

  • If the INSERT is part of a stored procedure, use sp_helptext 'ProcedureName'; to extract the full definition.
  • Update the procedure to reflect the corrected column list and redeploy using ALTER PROCEDURE.
  • Re-test any downstream applications or ETL jobs that call this procedure to ensure compatibility.

Alternative or Verification Steps

  • After applying the fix, execute the query in a non-production environment and confirm it completes without Error 120, then verify row counts in the target table using SELECT COUNT(*) FROM TableName;.
  • If the issue persists in an ORM-generated query (e.g., Entity Framework), regenerate the model from the database schema to ensure column mappings are synchronized with the current table structure.

How to fix Error 121 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 121 – Column Mismatch in INSERT Statement

Why This Error Happens

This error occurs when the number of columns specified in the SELECT clause does not equal the number of columns defined in the INSERT statement’s target list. It is typically caused by a schema change—such as a newly added or dropped column in the source or destination table—that was not reflected in the corresponding T-SQL script. Legacy stored procedures or ETL packages migrated to SQL Server 2025 are especially prone to this issue if column definitions were altered post-migration without updating dependent code.

Step-by-Step Resolution Guide

Step 1: Identify the Exact Statement Causing the Error

  • Open the query in SQL Server Management Studio (SSMS) connected to your SQL Server 2025 instance.
  • Note the line number referenced in the Error 121 message in the Messages pane.
  • Isolate the specific INSERT INTO ... SELECT statement causing the failure.

Step 2: Compare Column Counts Manually

  • Run sp_help 'YourTableName'; or query INFORMATION_SCHEMA.COLUMNS to get the exact column count and order for the target table.
  • Count the columns explicitly listed in the INSERT INTO TableName (Col1, Col2, ...) clause.
  • Count the columns/expressions listed in the SELECT clause immediately following, including any subqueries or joined columns.

Step 3: Correct the Column Lists

  • If the INSERT list has fewer columns than the SELECT list, either remove the extra column(s) from SELECT or add matching column(s) to the INSERT list.
  • If using SELECT *, replace it with an explicit column list to avoid future mismatches (especially important after schema changes in Windows Server 2025 environments with automated deployment pipelines).
  • Save and re-run the corrected script in SSMS.

Step 4: Check for Hidden Computed or Identity Columns

  • Verify whether the target table has an IDENTITY column; if so, ensure it is either excluded from both lists or explicitly handled with SET IDENTITY_INSERT TableName ON.
  • Check for computed columns that may be unintentionally included in SELECT * results.

Step 5: Validate Views or Linked Server Sources

  • If the SELECT source is a view or linked server table, confirm that its underlying schema hasn’t changed (common after Windows Update-triggered SQL Server cumulative updates).
  • Run sp_refreshview 'ViewName'; to update metadata if the view’s structure was altered.

Alternative or Verification Steps

  • Execute the corrected query in a test environment first; a successful execution with the expected row count confirms the fix.
  • If the error persists intermittently, check for dynamic SQL execution paths (e.g., sp_executesql) where the column list may be built programmatically and inspect the generated string using PRINT before execution.

How to fix Error 122 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 122 — “The %ls option is allowed only with %ls syntax”

Why This Error Happens

This error occurs when a T-SQL statement uses a command-line style option or clause in conjunction with an incompatible syntax structure, most commonly seen with BACKUP, RESTORE, BULK INSERT, or OPENROWSET statements. SQL Server 2025’s parser enforces strict compatibility rules between certain options (like WITH FORMATFILE, SINGLE_BLOB, or FILESTREAM-related clauses) and the specific syntax variant they must be paired with. This typically stems from a malformed or legacy query—often migrated from an older SQL Server version—where an option valid in one syntax mode (e.g., BULK rowset provider) is mistakenly applied to another (e.g., standard INSERT).

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Check the SQL Server Error Log or the client application’s error output to capture the full, non-truncated error message and the exact query text.
  • Look specifically for placeholders like %ls being replaced with clause names such as SINGLE_CLOB, CODEPAGE, or ORDER.
  • Use SQL Server Management Studio (SSMS) 21 (compatible with SQL Server 2025) to re-run the isolated statement to reproduce the error in a controlled environment.

Step 2: Cross-Reference Syntax Documentation

  • Open the current Microsoft Docs reference for the specific command (e.g., BULK INSERT or OPENROWSET(BULK...)) to verify the exact syntax tree for SQL Server 2025.
  • Verify that options like FORMATFILE, FIRSTROW, or ROWTERMINATOR are being used strictly within the WITH (...) clause and not mixed with deprecated inline syntax.
  • Pay close attention to the placement of the BULK keyword; it must directly follow OPENROWSET( and cannot be used as a standalone modifier in a standard SELECT statement.

Step 3: Rewrite and Sanitize the Query

  • Remove any options that are mutually exclusive. For example, ensure SINGLE_BLOB or SINGLE_CLOB is not used alongside row-based options like FIELDTERMINATOR.
  • Update file paths to use fully qualified UNC paths (e.g., \\ServerName\Share\file.csv) rather than local paths, as Windows Server 2025 network path resolution can sometimes trigger parser conflicts if paths are ambiguous.
  • Restructure the query to align with the specific syntax variant demanded by the error (e.g., moving from BULK INSERT syntax to OPENROWSET(BULK...) syntax if the option requires it).

Step 4: Update SQL Server Client Tools

  • Ensure that sqlcmd or the OLE DB driver used to submit the query is updated to the latest version supporting SQL Server 2025 (Version 18 or higher).
  • Older drivers on Windows 11 client machines may format queries using deprecated syntax patterns that trigger this parser error on the newer server engine.

Alternative or Verification Steps

  • Verification: Execute the corrected query in a SET PARSEONLY ON session first. If the query compiles without throwing Error 122, toggle SET PARSEONLY OFF and run it live to confirm data retrieval.
  • Alternative: If the error persists specifically with BULK INSERT, pivot to using the OPENROWSET(BULK...) syntax instead, as it often provides more flexible support for the specific option causing the conflict.

How to fix Error 116 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 116 — “Only One Expression Can Be Specified in the Select List”

Why This Error Happens

This error occurs when a subquery used in a comparison expression (such as with =, <, >, or in a WHERE clause) returns multiple columns instead of a single scalar value. SQL Server 2025’s query optimizer strictly enforces that non-EXISTS subqueries must resolve to exactly one column per row, since the engine cannot map multiple return values to a single comparison operator. This typically stems from a poorly structured SELECT statement inside the subquery, an accidental SELECT *, or a missing column-specific filter that was intended to narrow the result set.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Subquery

  • Open the query in SQL Server Management Studio (SSMS 21) or Azure Data Studio connected to your SQL Server 2025 instance.
  • Locate the exact line number referenced in the error output (SSMS will highlight it in the Messages pane).
  • Check if the subquery uses SELECT * or SELECT col1, col2 instead of a single column.

Step 2: Rewrite the Subquery to Return a Single Column

  • Modify the SELECT clause inside the subquery to explicitly reference only one column, e.g., SELECT CustomerID FROM Orders WHERE ... instead of SELECT CustomerID, OrderDate FROM Orders.
  • If you need to compare against multiple columns, refactor the query to use EXISTS or IN with a correlated subquery instead of a direct equality comparison.
  • Example fix:
  -- Incorrect
  SELECT * FROM Employees WHERE (Salary, DeptID) = (SELECT Salary, DeptID FROM Managers WHERE ManagerID = 5)

  -- Corrected
  SELECT * FROM Employees WHERE Salary = (SELECT Salary FROM Managers WHERE ManagerID = 5)

Step 3: Validate Data Model and Joins

  • Confirm the subquery’s underlying table doesn’t have duplicate logical columns due to a bad JOIN condition that inflates the column count.
  • Check the file path C:\Program Files\Microsoft SQL Server\160\Tools\Binn\ (adjust version folder for SQL Server 2025) to ensure your SSMS/query tool build is current, as outdated parsers occasionally mis-flag valid syntax.
  • Update SSMS via Help > Check for Updates if using an older build against the 2025 engine.

Step 4: Test Query Execution Plan

  • Run SET SHOWPLAN_XML ON before executing the corrected query to confirm SQL Server accepts the single-column subquery.
  • Review the execution plan for any residual multi-column references that may cascade from nested subqueries.

Alternative or Verification Steps

  • Re-run the corrected query in SSMS and confirm it returns results without triggering Error 116; check the Messages tab for a clean execution with zero errors.
  • If the issue persists, replace the subquery with a JOIN or CROSS APPLY construct, which often resolves ambiguity in multi-column comparisons more reliably than scalar subqueries.

How to fix Error 117 on Windows Server 2025 / Windows 11

Why This Error Happens

This error occurs when a multi-part object identifier in a Transact-SQL statement exceeds the maximum number of allowed prefixes, which SQL Server caps at four parts (server.database.schema.object). It is typically triggered by malformed queries, dynamically generated SQL with incorrect string concatenation, or linked server references that accidentally duplicate a naming segment. In some cases, this also surfaces after a botched find-and-replace operation in ORM-generated code or migration scripts that append extra dots or brackets to object names.

Step-by-Step Resolution Guide

Step 1: Isolate the Offending Query

  • Check the SQL Server error log or SSMS “Messages” tab to identify the exact query text referenced by the '%.*ls' placeholder.
  • Use SQL Server Profiler or Extended Events (sqlserver.error_reported) filtered on Error 117 to capture the exact batch text in real time.
  • Look specifically for object names formatted like Server.Database.Schema.Schema.Table or similar duplicated segments.

Step 2: Correct the Multi-Part Identifier Syntax

  • Open the script or stored procedure flagged in Step 1 in SSMS (SQL Server Management Studio 21, compatible with SQL Server 2025).
  • Manually count the dot-separated segments in the identifier; valid syntax must not exceed Server.Database.Schema.Object.
  • Remove any redundant prefixes, especially in dynamically built strings such as EXEC sp_executesql @sql = N'SELECT * FROM ' + @srv + '.' + @db + '.' + @schema + '.' + @schema + '.' + @tbl.
  • Save and re-run the corrected script in a test environment before deploying to production.

Step 3: Audit Dynamic SQL and ORM-Generated Code

  • Review any Entity Framework, Dapper, or third-party ORM configuration files that generate fully qualified table names, since misconfigured connection strings sometimes inject an extra database or schema segment.
  • Check linked server definitions in sys.servers (via SELECT * FROM sys.servers;) to confirm the linked server name itself does not contain embedded periods, which can inflate the perceived prefix count.
  • Update any string-building functions or stored procedures that concatenate identifiers to use QUOTENAME() correctly instead of manual string concatenation.

Step 4: Validate Compatibility Level Settings

  • Confirm the database compatibility level is correctly set for SQL Server 2025 by running:
    SELECT name, compatibility_level FROM sys.databases WHERE name = 'YourDatabaseName';
  • If the compatibility level is outdated (e.g., inherited from a restored SQL Server 2016 backup), update it using:
    ALTER DATABASE YourDatabaseName SET COMPATIBILITY_LEVEL = 170;
  • Re-test the query, as older compatibility levels occasionally parse multi-part names differently and can mask or worsen the prefix-count issue.

Alternative or Verification Steps

  • Re-execute the corrected script in SSMS or Azure Data Studio and confirm Error 117 no longer appears in the Messages pane or the SQL Server error log.
  • If the error persists, run DBCC FREEPROCCACHE to clear any cached execution plans referencing the malformed identifier, then re-test the query from a fresh session.

How to fix Error 119 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 119 – Parameter Mismatch

Why This Error Happens

This error occurs when a stored procedure or function call mixes positional parameters with named parameters in the wrong order, specifically when a @name = value format is used and then followed by a positional value without a name. SQL Server 2025 enforces strict parameter-passing rules: once you switch to the named notation (@parameter = value), every subsequent parameter in that same call must also use the named notation. This is typically caused by application code, ORM-generated queries, or manually written T-SQL scripts that inconsistently pass parameters to a stored procedure.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query or Procedure Call

  • Check the SQL Server error log or Windows Event Viewer (Applications and Services Logs > MSSQLSERVER) for the exact statement referenced in Error 119.
  • Use SQL Server Management Studio (SSMS) Activity Monitor or sys.dm_exec_query_stats to locate the recently executed batch that triggered the failure.
  • Note the stored procedure name and the parameter list exactly as submitted by the client.

Step 2: Correct the Parameter Syntax in the Calling Code

  • Open the application code, reporting script, or T-SQL batch responsible for the call (common in C#, PowerShell, or SSRS datasets).
  • Ensure that once one parameter uses @name = value format, all parameters following it in the same call also use @name = value.
  • Example of incorrect syntax:
  EXEC dbo.GetCustomerData @CustomerID = 101, 'Active'
  • Corrected syntax:
  EXEC dbo.GetCustomerData @CustomerID = 101, @Status = 'Active'

Step 3: Update ORM or Application Parameter Binding Logic

  • If using Entity Framework, Dapper, or a custom data access layer, verify that the parameter collection is built consistently (either fully named or fully positional, never mixed).
  • For ADO.NET SqlCommand objects, confirm that Parameters.AddWithValue or Parameters.Add calls populate @name for every parameter without skipping any in the middle of the collection.
  • Redeploy the corrected application build to your Windows Server 2025 / Windows 11 environment.

Step 4: Test the Corrected Procedure Call

  • Run the corrected EXEC statement directly in SSMS or Azure Data Studio connected to the SQL Server 2025 instance.
  • Confirm the procedure executes without throwing Error 119.
  • Check for any downstream errors (e.g., data type mismatches) that may have been masked by the original syntax error.

Alternative or Verification Steps

  • Enable SQL Server Extended Events (sqlserver.error_reported) filtered on Error 119 to catch any recurring instances across other stored procedures in the database.
  • If the issue persists in third-party or vendor software, revert to fully positional parameter calls (no @name = at all) as a temporary workaround while awaiting a vendor patch.

How to fix Error 113 on Windows Server 2025 / Windows 11

Why This Error Happens

SQL Server Error 113 occurs when the T-SQL parser encounters an opening block comment marker (/*) but reaches the end of the batch or script without finding its corresponding closing marker (*/). This is typically caused by an unclosed nested comment, a comment block that spans multiple files (such as in build scripts or CI/CD pipelines) where concatenation breaks the pairing, or an accidental deletion of the closing tag during manual editing. Because SQL Server requires balanced comment delimiters within a single batch, even one missing */ will cause the entire script to fail parsing.

Step-by-Step Resolution Guide

Step 1: Isolate the Faulty Script Block

  • Open the script in SQL Server Management Studio (SSMS) on your Windows Server 2025 / Windows 11 machine.
  • Use Ctrl+F to search for all instances of /* and */ and manually count them — they must match in number.
  • Pay close attention to nested comments, as SQL Server’s parser does not always support infinite nesting depth depending on version compatibility settings.

Step 2: Check for Multi-File or Batch Concatenation Issues

  • If the script is generated by a build tool or deployment pipeline (e.g., SSDT, Flyway, or a custom PowerShell concatenation script), verify that comment blocks are not split across files.
  • Inspect the generated .sql output file directly in a text editor like VS Code to confirm the */ wasn’t truncated during file merging.
  • Run Get-Content .\yourscript.sql | Select-String "/\*|\*/" in PowerShell to quickly list all comment markers and their line numbers for auditing.

Step 3: Correct and Re-Validate the Comment Syntax

  • Manually insert the missing */ at the appropriate closing location based on the logical intent of the comment.
  • Avoid using -- (single-line comment) accidentally inside a block comment, as this does not close a /* block and can mislead visual inspection.
  • Save the corrected script and re-parse it in SSMS using the Query > Parse menu option (or Ctrl+F5) before execution.

Step 4: Re-Run the Script in a Controlled Environment

  • Execute the corrected script against a test/staging instance of SQL Server 2025 first, not production.
  • Confirm the batch completes without throwing Error 113 or any subsequent syntax errors that may have been masked by the original parsing failure.

Alternative or Verification Steps

  • Run SET PARSEONLY ON; followed by executing just the problematic batch in SSMS — this validates syntax without executing the query, confirming the comment issue is resolved.
  • If the error persists in generated/dynamic SQL, temporarily strip all comments using a regex tool (e.g., (?s)/\*.*?\*/) to isolate whether the issue lies in comment syntax or elsewhere in the query logic.

How to fix Error 114 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 114 – “Browse Mode Is Invalid for a Statement That Assigns Values to a Variable”

Why This Error Happens

This error occurs when a SELECT statement includes the FOR BROWSE option while simultaneously attempting to assign a column value to a local variable (e.g., SELECT @var = column_name FROM table FOR BROWSE). SQL Server 2025 does not allow browse mode—which is designed to return metadata for client-side cursor updates—to coexist with variable assignment logic in the same statement. This typically results from legacy T-SQL code, ORM-generated queries, or ODBC/DB-Library client applications that implicitly append FOR BROWSE when configuring certain cursor or connection properties.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Use SQL Server Profiler or Extended Events on Windows Server 2025 to capture the exact statement triggering Error 114.
  • Check application logs or connection strings for cursor-based settings that force FOR BROWSE mode.
  • Look specifically for T-SQL patterns like SELECT @variable = ColumnName ... FOR BROWSE.

Step 2: Remove or Refactor the FOR BROWSE Clause

  • Edit the stored procedure or query to eliminate FOR BROWSE if variable assignment is required.
  • Replace variable assignment logic with a standard SELECT statement without FOR BROWSE, then handle result sets separately if browse mode metadata is genuinely needed elsewhere.
  • Example fix:
  • Incorrect: SELECT @Total = SUM(Amount) FROM Sales FOR BROWSE
  • Corrected: SELECT @Total = SUM(Amount) FROM Sales

Step 3: Audit Client Connection Settings

  • Check ODBC Data Source Administrator (odbcad32.exe) on Windows 11/Server 2025 for DSNs with “Use ANSI Quoted Identifiers” or cursor library settings enabling browse mode by default.
  • Review application connection strings for flags such as SET FMTONLY or driver-level cursor options (common in older ADO/OLE DB clients) that implicitly request FOR BROWSE.
  • Disable server-side cursors in the client driver configuration if not explicitly required.

Step 4: Update Client Drivers and Application Code

  • Ensure the application is using the latest Microsoft OLE DB Driver or ODBC Driver compatible with SQL Server 2025.
  • Recompile or redeploy stored procedures after removing incompatible browse-mode syntax.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear cached execution plans.

Alternative or Verification Steps

  • Re-run the corrected query in SQL Server Management Studio (SSMS) to confirm Error 114 no longer appears and the variable assignment executes successfully.
  • If the error persists, use sp_helptext on the affected stored procedure to confirm no residual FOR BROWSE clauses remain, and validate that no linked server or dynamic SQL calls are reintroducing the browse mode flag.

How to fix Error 115 on Windows Server 2025 / Windows 11

Why This Error Happens

Error 115 occurs because SQL Server’s T-SQL syntax does not permit the FOR UPDATE clause to be combined with set operators such as UNION, UNION ALL, INTERSECT, or EXCEPT within the same statement. This is a parser-level restriction rather than a permissions or configuration issue — the query engine cannot determine cursor-updatability semantics when multiple result sets are being merged. It typically surfaces when legacy code (often ported from Oracle or Sybase) or auto-generated ORM queries attempt to declare an updatable cursor over a combined result set.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Locate the exact T-SQL batch referenced in the error message using SQL Server Management Studio (SSMS) or Azure Data Studio.
  • Check the DECLARE CURSOR statement for a FOR UPDATE clause combined with UNION, UNION ALL, INTERSECT, or EXCEPT.
  • Run the query in isolation to confirm Error 115 is reproducible outside of the application layer.

Step 2: Refactor the Cursor Logic

  • Split the query into separate DECLARE CURSOR ... FOR UPDATE statements, one per underlying table involved in the set operation.
  • Alternatively, remove the FOR UPDATE clause and instead perform updates using a WHERE CURRENT OF pattern against a single-table subquery, or switch to a read-only cursor combined with a separate UPDATE ... WHERE statement based on the retrieved key values.
  • If the intent was simply to filter and then modify rows, replace the cursor-based logic with a set-based UPDATE statement using a JOIN or MERGE instead of UNION.

Step 3: Update Application or ORM-Generated Code

  • Review any Entity Framework, Hibernate, or legacy Sybase/Oracle migration scripts that auto-generate cursor syntax, since these often produce invalid FOR UPDATE + set operator combinations.
  • Manually patch the generated SQL template or add a custom query override in the data access layer to avoid combining set operators with updatable cursors.
  • Save the corrected script to C:\Scripts\SQL\Fixes\ (or your team’s standard repository path) for version control and future audits.

Step 4: Test in a Non-Production Environment

  • Deploy the corrected script to a staging instance of SQL Server 2025 running on Windows Server 2025 or Windows 11.
  • Execute the batch via sqlcmd -S <ServerName> -i FixedScript.sql to confirm no Error 115 is thrown.
  • Monitor the SQL Server Error Log (Management > SQL Server Logs in SSMS) for any residual syntax warnings.

Alternative or Verification Steps

  • Verify the fix by re-running the original failing procedure or application transaction and confirming that no Error 115 appears in the SQL Server Error Log or client application output.
  • As an alternative, if refactoring the cursor is not feasible short-term, wrap the set-operation query in a temporary table or table variable first, then declare the FOR UPDATE cursor against that single temporary object instead of the combined result set directly.

How to fix Error 110 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 110 — Column/Value Mismatch in INSERT Statement

Why This Error Happens

Error 110 occurs when the number of columns explicitly listed in the INSERT INTO clause does not match the number of values supplied in the corresponding VALUES clause. This is typically caused by a manually written or dynamically generated SQL statement where a column was added, removed, or omitted without updating the values list accordingly. It can also arise from application code (ORMs, stored procedures, or ETL scripts) that builds INSERT statements programmatically and miscounts placeholders or parameters during string concatenation.

Step-by-Step Resolution Guide

Step 1: Identify the Exact Statement Throwing the Error

  • Check the SQL Server error log or SSMS output pane for the specific line number and batch that raised Error 110.
  • Copy the failing INSERT statement into a query window in SQL Server Management Studio (SSMS) for isolated testing.
  • If the query is generated by an application, enable SQL Profiler or Extended Events to capture the exact text of the statement as executed.

Step 2: Count and Align Columns with Values

  • Manually count the number of columns listed inside the parentheses after the table name.
  • Count the number of values listed inside the parentheses after the VALUES keyword.
  • Ensure every column has a corresponding value, including columns that require NULL, DEFAULT, or a computed value.
  • Example correction:
  -- Incorrect (3 columns, 2 values)
  INSERT INTO dbo.Employees (EmployeeID, FirstName, LastName)
  VALUES (101, 'John');

  -- Corrected (3 columns, 3 values)
  INSERT INTO dbo.Employees (EmployeeID, FirstName, LastName)
  VALUES (101, 'John', 'Doe');

Step 3: Validate Multi-Row INSERT Statements

  • If using a multi-row VALUES clause (e.g., VALUES (1,2,3),(4,5,6)), confirm that every row-tuple has the same number of elements as the column list.
  • Look for trailing or missing commas that can accidentally shift value groupings.
  • Use SSMS’s built-in IntelliSense (Ctrl+Shift+Q “Refresh Local Cache”) to help visually confirm alignment.

Step 4: Audit Application-Generated Queries

  • If the INSERT statement is built dynamically in C#, Python, or another application layer, review the code for string concatenation logic or parameterized query construction.
  • Check for loops that append values but fail to append a corresponding column name (or vice versa).
  • Add defensive coding (e.g., array length checks between the columns[] and values[] arrays) before executing the query against SQL Server 2025.

Step 5: Test in a Non-Production Environment

  • Before redeploying the corrected script, execute it in a Windows Server 2025/Windows 11 test instance connected to a SQL Server 2025 sandbox database.
  • Confirm the statement executes without Error 110 and inserts the expected row(s).

Alternative or Verification Steps

  • Run SELECT @@ROWCOUNT; immediately after the corrected INSERT statement to confirm that exactly one (or the expected number of) row(s) were affected.
  • If the issue persists in application-generated code, switch to explicitly naming all columns and using parameterized queries (e.g., SqlCommand.Parameters.AddWithValue) instead of raw string concatenation to eliminate manual counting errors entirely.

How to fix Error 111 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 111 – “‘%ls’ must be the first statement in a query batch”

Why This Error Happens

This error occurs when certain T-SQL statements—such as CREATE PROCEDURE, CREATE VIEW, CREATE FUNCTION, CREATE TRIGGER, or CREATE SCHEMA—are not placed as the very first statement in a query batch. SQL Server 2025’s parser enforces strict batch-scoping rules for object-creation DDL statements, meaning any preceding statement (even a comment block that isn’t properly formatted, or a USE statement without a GO separator) will trigger this error. This is typically a query-authoring issue rather than a server configuration or corruption problem, but it can also surface due to improperly generated scripts from ORM tools or migration frameworks.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement

  • Open the query in SSMS or Azure Data Studio and locate the CREATE PROCEDURE, CREATE VIEW, CREATE FUNCTION, or CREATE TRIGGER statement referenced in the error message.
  • Check the lines immediately above it for any other executable statements (e.g., SELECT, DECLARE, SET, IF, USE).

Step 2: Insert a Batch Separator

  • Add a GO statement immediately before the CREATE statement to force it into its own batch.
  • Example fix:
  USE MyDatabase;
  GO
  CREATE PROCEDURE dbo.MyProc
  AS
  BEGIN
      SELECT 1;
  END
  GO
  • Ensure there is only one CREATE object statement per batch—do not combine multiple CREATE PROCEDURE statements in a single batch even if separated by semicolons.

Step 3: Review Semicolon Usage and Comments

  • Confirm any multi-line comments (/* ... */) preceding the CREATE statement are fully closed; an unclosed comment can cause the parser to misidentify batch boundaries.
  • Remove stray semicolons or empty statements before the CREATE keyword, as SQL Server 2025 treats ; as a statement terminator that can inadvertently end up mid-batch.

Step 4: Validate Script Generation Tools

  • If the script was auto-generated (e.g., via Entity Framework migrations, dbForge, or SSDT), check the export/generation settings to ensure GO separators are inserted correctly between DDL statements.
  • Regenerate the script with “Include batch separators” enabled if using SSMS’s “Generate Scripts” wizard (Database → Tasks → Generate Scripts → Advanced → Script Statement Type).

Step 5: Re-run in Isolation

  • Copy just the problematic CREATE statement into a new query window by itself and execute it to confirm it runs cleanly without any preceding statements.
  • Once validated, reintegrate it into the full script with proper GO batch separation.

Alternative or Verification Steps

  • Verify the fix by executing the corrected script end-to-end in SSMS with SQLCMD Mode enabled (Query menu → SQLCMD Mode) to ensure GO separators are respected exactly as written.
  • If using a deployment pipeline (e.g., SSDT/DACPAC or Flyway), run a dry-run/validation build first, as these tools often auto-insert correct batch separators and can bypass manual scripting errors entirely.

How to fix Error 112 on Windows Server 2025 / Windows 11

Why This Error Happens

SQL Server Error 112 occurs when a Transact-SQL variable (e.g., @dbname) is used in a statement that requires a literal, compile-time constant instead of a runtime value. Statements like USE, CREATE DATABASE, or certain DDL/context-switching commands are parsed and bound before variable values are resolved, so the SQL Server engine rejects the syntax outright. This is typically a query-design issue rather than a server configuration or corruption problem, often introduced by developers attempting to parameterize database names or schema references directly.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and locate the exact line referenced in the error message.
  • Look specifically for USE @variable, CREATE DATABASE @variable, or similar patterns where a variable replaces a literal identifier.
  • Run the query in isolation to confirm Error 112 is tied to that specific line.

Step 2: Convert the Statement to Dynamic SQL

  • Since static statements like USE cannot accept variables, wrap the logic in dynamic SQL using sp_executesql instead.
  • Example fix:
  DECLARE @dbname NVARCHAR(128) = N'MyDatabase';
  DECLARE @sql NVARCHAR(MAX) = N'USE ' + QUOTENAME(@dbname);
  EXEC sp_executesql @sql;
  • Always use QUOTENAME() to prevent SQL injection when concatenating identifiers.

Step 3: Refactor Stored Procedures or Scripts

  • Search all stored procedures, triggers, and deployment scripts in the affected database for similar variable misuse in restricted statements (e.g., BACKUP DATABASE, RESTORE, ALTER DATABASE).
  • Update each instance to use the dynamic SQL pattern from Step 2.
  • Save and redeploy the corrected script via SSMS or your CI/CD pipeline.

Step 4: Validate Compatibility Level Settings

  • On SQL Server 2025 running under Windows Server 2025, confirm the database compatibility level isn’t forcing legacy parsing behavior that surfaces this error unexpectedly.
  • Check via:
  SELECT name, compatibility_level FROM sys.databases WHERE name = 'MyDatabase';
  • Adjust only if organizational policy permits, using ALTER DATABASE MyDatabase SET COMPATIBILITY_LEVEL = 170;

Alternative or Verification Steps

  • Re-run the corrected script or stored procedure and confirm it executes without Error 112 in the SSMS “Messages” tab.
  • If the error persists in a third-party application, capture a SQL Profiler trace or Extended Events session to identify the exact generated query text being submitted to the engine.

How to fix Error 107 on Windows Server 2025 / Windows 11

Why This Error Happens

Error 107 occurs when a T-SQL query references a table alias or column prefix that SQL Server’s parser cannot resolve against the FROM clause. This is typically caused by a typo in the alias name, a missing table alias declaration when using multi-part column names (e.g., t1.ColumnName), or referencing a table/view that was renamed or dropped without updating the query. It can also surface after a schema migration to SQL Server 2025 where legacy queries used inconsistent aliasing conventions no longer tolerated by the updated query optimizer.

Step-by-Step Resolution Guide

Step 1: Review the Exact Query Text and Identify the Faulty Prefix

  • Open the query in SQL Server Management Studio (SSMS) and locate the exact column prefix mentioned in the error message (the %.*ls placeholder will show the actual alias/table name in the real error output).
  • Check every FROM and JOIN clause to confirm the alias exists and is spelled identically everywhere it’s used.
  • Run the query with SET PARSEONLY ON; first to validate syntax without execution.

Step 2: Verify Table Aliases and Multi-Part Naming Consistency

  • Ensure every table referenced with a prefix (e.g., o.OrderID) has a corresponding alias defined in the FROM clause, such as FROM Orders o.
  • Confirm there are no duplicate aliases across joined tables or subqueries.
  • If using derived tables or CTEs, verify the alias is declared immediately after the closing parenthesis, e.g. ) AS SubQ.

Step 3: Validate the Underlying Table or View Still Exists

  • Run sp_help 'TableName'; or query sys.objects to confirm the referenced table/view has not been renamed, dropped, or moved to a different schema during migration to SQL Server 2025.
  • If the object was renamed, update all query references and any dependent views/stored procedures using sys.sql_expression_dependencies.
  • Recompile affected stored procedures with EXEC sp_recompile 'ProcedureName'; after correcting references.

Step 4: Check for Case Sensitivity or Collation Mismatches

  • If the database uses a case-sensitive collation, confirm the alias casing in the query exactly matches the declared alias.
  • Run SELECT DATABASEPROPERTYEX('YourDB', 'Collation'); to confirm collation settings post-migration to Windows Server 2025.

Alternative or Verification Steps

  • Re-run the corrected query in SSMS or Azure Data Studio and confirm it executes without Error 107 and returns expected result sets.
  • If the error persists in a stored procedure or view, use sp_helptext 'ObjectName'; to inspect the full definition and confirm no legacy syntax remains unresolved, then re-deploy the corrected object.

How to fix Error 108 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 108

Why This Error Happens

Error 108 occurs when a ORDER BY clause references a column position number (e.g., ORDER BY 5) that exceeds the actual number of columns returned in the SELECT list. This is typically caused by a mismatch between a dynamically generated query and its underlying result set, often introduced after a schema change, a modified stored procedure, or an application update that altered the number of selected columns without updating the corresponding ORDER BY ordinal. It can also occur when copy-pasted T-SQL code retains an old ordinal reference from a query with more columns than the current one.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Open SQL Server Management Studio (SSMS) on your Windows Server 2025 / Windows 11 instance and enable “Include Actual Execution Plan” or check the Application Event Viewer for the exact query text tied to Error 108.
  • Use the following query against sys.dm_exec_query_stats to locate recently failed queries by text pattern:
SELECT qt.text, qs.execution_count
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) qt
WHERE qt.text LIKE '%ORDER BY%'
  • Note the exact ordinal number referenced in the ORDER BY clause (e.g., ORDER BY 6).

Step 2: Count the Columns in the SELECT List

  • Manually count every column, expression, and computed value listed between SELECT and FROM in the flagged query.
  • Confirm whether the ORDER BY ordinal number is higher than this count — this confirms the root cause.
  • Check for recent ALTER TABLE... DROP COLUMN or view modifications in sys.objects that may have reduced the column count without updating dependent queries.

Step 3: Correct the ORDER BY Clause

  • Edit the query or stored procedure to either reduce the ordinal number to a valid value within range, or replace the ordinal with the explicit column name for clarity and future stability.
  • Example fix:
-- Incorrect
SELECT Name, Price FROM Products ORDER BY 3;

-- Corrected
SELECT Name, Price FROM Products ORDER BY Price;
  • If the query is generated by an application (e.g., an ORM or reporting tool), update the query template or mapping file at the application layer, not just directly in SQL Server.

Step 4: Redeploy and Test the Corrected Object

  • Save and redeploy the modified stored procedure, view, or application query using sp_recompile if it’s a stored procedure:
EXEC sp_recompile 'dbo.YourStoredProcedureName';
  • Restart the SQL Server Agent service or the affected application pool (via IIS Manager on Windows Server 2025) if the query is embedded in a scheduled job or web service.

Alternative or Verification Steps

  • Run the corrected query directly in SSMS to confirm it executes without Error 108 and returns expected sorted results.
  • As an alternative, refactor all legacy ORDER BY ordinal references across your codebase to use explicit column names, preventing recurrence when column counts change in the future.

How to fix Error 109 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 109 – Column and Value Count Mismatch in SQL Server 2025

Why This Error Happens

Error 109 occurs when the number of columns explicitly listed in an INSERT INTO statement does not equal the number of values supplied in the corresponding VALUES clause. This is typically caused by a manually miswritten query, a copy-paste error when modifying an existing script, or a mismatch introduced when a table schema is altered (e.g., a column added or dropped) without updating dependent insert scripts. SQL Server’s parser strictly validates this 1:1 mapping before execution and will halt the batch rather than guess column alignment.

Step-by-Step Resolution Guide

Step 1: Review the Exact INSERT Statement Syntax

  • Open the query in SQL Server Management Studio (SSMS) 21 or Azure Data Studio.
  • Count the columns listed inside the parentheses after the table name, e.g., INSERT INTO dbo.Customers (CustomerID, Name, Email).
  • Count the values listed inside the VALUES (...) clause and ensure the totals match exactly, including any NULL or DEFAULT placeholders.

Step 2: Cross-Check Against the Current Table Schema

  • Run the following command to see the live column list and detect recent schema changes:
EXEC sp_help 'dbo.Customers';
  • Alternatively, query INFORMATION_SCHEMA.COLUMNS:
SELECT COLUMN_NAME, ORDINAL_POSITION 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_NAME = 'Customers';
  • Confirm whether a column was added/removed by a ALTER TABLE operation that the script wasn’t updated to reflect.

Step 3: Correct the INSERT Statement

  • Add missing values or remove extra column names so both lists align 1:1.
  • If inserting into all columns, consider omitting the column list entirely (though explicit listing is best practice):
INSERT INTO dbo.Customers 
VALUES (101, 'John Doe', 'john@example.com');
  • For multi-row inserts, verify every row in the VALUES clause has the same number of entries as the column list.

Step 4: Validate Multi-Row or Bulk Insert Scripts

  • If the error originates from a bulk script or ETL job (e.g., SSIS package or generated migration script), open the source file in a text editor with line numbering (Notepad++ or VS Code on Windows 11).
  • Search for trailing commas or missing commas that may have shifted value alignment between rows.

Alternative or Verification Steps

  • Re-run the corrected script in a test/staging database first; confirm it executes with “X rows affected” and no Error 109.
  • If the issue stems from an automated tool or ORM-generated script, regenerate the INSERT statements after refreshing the table metadata cache to ensure column definitions are current.

How to fix Error 104 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 104 – “ORDER BY items must appear in the select list if the statement contains a UNION”

Why This Error Happens

This error occurs because SQL Server’s query engine enforces strict compliance rules when combining result sets with the UNION operator. When an ORDER BY clause references a column alias, ordinal position, or expression that is not explicitly present in the final SELECT list, the engine cannot resolve which column to sort by across the combined result sets. This is not a server configuration or permissions issue—it is a T-SQL syntax violation typically introduced by application-level query builders, ORM-generated queries, or manually written stored procedures on SQL Server 2025.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Check the SQL Server Error Log or Extended Events session for the exact query text triggering Error 104.
  • Use SELECT * FROM sys.dm_exec_query_stats cross-referenced with sys.dm_exec_sql_text to pull the full statement if it originated from an application connection pool.
  • Look specifically for a UNION or UNION ALL statement followed by an ORDER BY clause at the end.

Step 2: Correct the SELECT List to Match ORDER BY

  • Ensure every column referenced in the ORDER BY clause exists by name (or alias) in the final SELECT statement of the union.
  • Example fix: Change SELECT Col1, Col2 FROM TableA UNION SELECT Col1, Col2 FROM TableB ORDER BY Col3 to explicitly include Col3 in both SELECT lists, or replace it with an ordinal position reference like ORDER BY 1, 2.
  • If using column aliases, make sure the alias defined in the first SELECT block is what the ORDER BY clause references, not a column name from the underlying table.

Step 3: Refactor Using a Derived Table or CTE (If Needed)

  • If the sort logic depends on a column that should not appear in final output, wrap the UNION query in a Common Table Expression (CTE) or derived table.
  • Example: WITH CombinedResults AS (SELECT Col1, Col2, Col3 FROM TableA UNION SELECT Col1, Col2, Col3 FROM TableB) SELECT Col1, Col2 FROM CombinedResults ORDER BY Col3.
  • This allows sorting by a column that is excluded from the outer SELECT projection.

Step 4: Update Application or Reporting Layer

  • If the query originates from an ORM (Entity Framework, Hibernate) or a BI tool connecting via ODBC/OLE DB on Windows Server 2025, update the query template or stored procedure rather than the raw generated SQL.
  • Redeploy the corrected stored procedure using SQL Server Management Studio (SSMS) 21 or Azure Data Studio, and recompile with EXEC sp_recompile 'YourProcedureName'.

Alternative or Verification Steps

  • Re-run the corrected query directly in SSMS against the SQL Server 2025 instance to confirm Error 104 no longer appears and the result set returns in the expected sort order.
  • If the issue persists in a reporting tool, use SQL Server Profiler or Extended Events to capture the exact query sent by the client—application-level caching may still be sending the old, unpatched query text.

How to fix Error 105 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Error 105 – “Unclosed Quotation Mark After the Character String”

Why This Error Happens

This error occurs when the SQL Server 2025 query parser encounters a string literal that begins with a single or double quotation mark but does not find a matching closing quote before the statement ends. This is typically caused by unescaped apostrophes within dynamic SQL strings (e.g., names like “O’Brien”), mismatched quote characters when concatenating variables, or corrupted/truncated T-SQL scripts generated by client applications. It can also surface when the QUOTED_IDENTIFIER session setting conflicts with how literals are formatted in a stored procedure or ORM-generated query.

Step-by-Step Resolution Guide

Step 1: Isolate the Offending Query String

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and locate the exact query logged in the error via sys.dm_exec_query_stats or SQL Server Profiler.
  • Look specifically for the %.*ls placeholder text in the error, then cross-reference it with the actual dynamic SQL string executed.
  • Run PRINT @YourDynamicSQLVariable before execution to visually inspect where the string terminates unexpectedly.

Step 2: Escape Special Characters in Dynamic SQL

  • Replace any single quotes within string data by doubling them up (e.g., change 'O'Brien' to 'O''Brien').
  • If using parameters, refactor the code to use sp_executesql with parameterized queries instead of raw string concatenation.
  • Example fix:
  SET @SQL = N'SELECT * FROM Users WHERE LastName = @LastName';
  EXEC sp_executesql @SQL, N'@LastName NVARCHAR(50)', @LastName = 'O''Brien';

Step 3: Verify QUOTED_IDENTIFIER Settings

  • Check the current session setting by running: DBCC USEROPTIONS;
  • Ensure QUOTED_IDENTIFIER is set to ON for the database context, as required by SQL Server 2025 for indexed views and computed columns:
  ALTER DATABASE [YourDatabaseName] SET QUOTED_IDENTIFIER ON;
  • Restart the specific session or application connection pool in Windows Server 2025 to apply the new session-level default.

Step 4: Audit Client-Side String Truncation

  • If the query is generated by an application (e.g., .NET, Python), check the client-side logs on Windows 11 for buffer overflow or string truncation warnings.
  • Ensure the application is not hitting a VARCHAR length limit that cuts the SQL string off mid-literal, leaving an opening quote with no closing pair.

Alternative or Verification Steps

  • Verification: Re-run the exact query in a new SSMS query window; if it executes without the Msg 105 error and returns a result set or “Command completed successfully,” the syntax is fixed.
  • Alternative: If the error persists intermittently, enable SQL Server Extended Events to capture sql_statement_completed errors in real-time, which will log the fully expanded string exactly as the engine received it, helping catch hidden non-printable characters causing the mismatch.

How to fix Error 106 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 106 – “Too Many Table Names in the Query”

Why This Error Happens

This error occurs when a single SQL query references more table names than SQL Server’s internal query parser can handle within its execution plan limits. It is typically triggered by overly complex queries that use excessive JOINs, UNIONs, subqueries, or dynamically generated SQL with a large number of referenced objects. This is not a permissions or connectivity issue, but rather an architectural limitation reached when the query optimizer cannot process the sheer volume of table references in one execution batch.

Step-by-Step Resolution Guide

Step 1: Identify and Analyze the Offending Query

  • Open SQL Server Management Studio (SSMS) and locate the exact query that triggered Error 106 (check the Activity Monitor or query history logs).
  • Count the number of distinct table references, including those introduced via views, derived tables, and CTEs (Common Table Expressions), since nested views count toward the total.
  • Check if the query was dynamically generated by an ORM (e.g., Entity Framework) or a reporting tool that may be auto-joining excessive tables.

Step 2: Refactor the Query to Reduce Table References

  • Break the single large query into multiple smaller queries using temporary tables (#TempTable) or table variables to stage intermediate results.
  • Replace deeply nested views with materialized (indexed) views or pre-aggregated tables to reduce the “unrolling” of table references during compilation.
  • Simplify UNION statements by consolidating logic into a single WHERE clause with OR conditions where possible, rather than joining multiple copies of the same table.

Step 3: Adjust Query Complexity Limits (If Applicable)

  • Navigate to the query’s execution settings and verify the FORCE ORDER or OPTION (MAXRECURSION 0) hints are not inadvertently causing the optimizer to expand join paths unnecessarily.
  • If using SQL Server 2025’s enhanced Intelligent Query Processing (IQP) features, ensure Cardinality Estimation compatibility level is set correctly via:
  • ALTER DATABASE [YourDB] SET COMPATIBILITY_LEVEL = 170;
  • Review any auto-generated SQL from BI tools (Power BI/SSRS) and manually optimize the DAX or M-query backend to limit the number of pushed-down joins.

Step 4: Restart the Query Optimizer Cache

  • Clear the procedure cache to ensure the server isn’t attempting to reuse a corrupted or overly complex execution plan.
  • Run the following T-SQL command in a new query window:
  • DBCC FREEPROCCACHE;
  • Re-execute the simplified query to confirm the parser accepts the new table count.

Alternative or Verification Steps

  • Verification: Re-run the modified query in SSMS and check the Execution Plan (Ctrl+M) to confirm all tables are resolving correctly without hitting the parser limit.
  • Alternative: If the query logic cannot be simplified, split the workload into a multi-step SQL Server Agent Job that populates a staging table incrementally, avoiding the need for a single monolithic query.

How to fix Error 101 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 101 – “Query Not Allowed in WAITFOR”

Why This Error Happens

SQL Server Error 101 occurs when a WAITFOR clause is used in conjunction with a statement type that does not support delayed or conditional execution, such as certain DDL statements, batch-level compiled statements, or queries referencing table variables that fall outside the allowed scope. This is a T-SQL syntax and parser-level restriction rather than a connectivity or permissions issue, meaning the SQL engine rejects the query before it ever reaches the execution plan stage. It commonly surfaces after upgrading to SQL Server 2025 due to stricter parsing rules introduced in the new query optimizer for WAITFOR DELAY and WAITFOR TIME combined with RECEIVE, SELECT INTO, or multi-statement table-valued functions.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement

  • Open SQL Server Management Studio (SSMS) 2025 or Azure Data Studio and locate the exact batch that triggered Error 101.
  • Check the Messages tab for the line number reference — SQL Server will point to the specific WAITFOR block.
  • Confirm whether the query uses WAITFOR alongside SELECT INTO, RECEIVE, or a Service Broker GET CONVERSATION GROUP statement, as these are the primary triggers.

Step 2: Refactor the WAITFOR Logic

  • Separate the WAITFOR statement from the unsupported query into two distinct batches using GO as a separator.
  • Example fix:
  WAITFOR DELAY '00:00:05';
  GO
  SELECT * INTO #TempResults FROM Orders WHERE OrderDate > GETDATE();
  • If using Service Broker, replace inline WAITFOR (RECEIVE ...) with a stored procedure wrapper that isolates the receive logic from the wait logic.

Step 3: Update Compatibility Level

  • Open SSMS and navigate to Database Properties > Options > Compatibility Level.
  • Ensure the database is set to compatibility level 160 or higher (SQL Server 2022/2025 engine) since older compatibility levels (110–130) have inconsistent WAITFOR parsing behavior.
  • Run the following T-SQL to verify and update:
  ALTER DATABASE [YourDBName] SET COMPATIBILITY_LEVEL = 160;

Step 4: Apply the Latest Cumulative Update (CU)

  • Navigate to Microsoft Update Catalog or use SQL Server Configuration Manager to check the current build version.
  • Download and install the latest Cumulative Update for SQL Server 2025, as early builds had a known parser bug (tracked internally as a WAITFOR/CTE conflict) that has since been patched.
  • Restart the SQL Server service via services.msc or run:
  Restart-Service MSSQLSERVER -Force

Step 5: Validate Query Structure Against Server-Side Restrictions

  • Ensure WAITFOR is not nested inside a multi-statement table-valued function (MSTVF) or an inline scalar function, as SQL Server 2025 now enforces stricter deterministic function rules.
  • Move any WAITFOR logic out of function bodies and into stored procedures or top-level batch scripts instead.

Alternative or Verification Steps

  • Verification: Re-run the original query in a new query window after applying the fixes; confirm no Error 101 appears in the Messages pane and check sys.dm_exec_requests to ensure the session isn’t stuck in a SUSPENDED wait state.
  • Alternative: If refactoring is not immediately feasible, wrap the entire batch in a stored procedure and call EXEC after the WAITFOR delay completes — this isolates the parser context and often bypasses the restriction without code restructuring.

How to fix Error 102 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 102 – “Incorrect Syntax Near ‘%.*ls'”

Why This Error Happens

Error 102 occurs when the SQL Server Query Parser encounters a token, keyword, or symbol that violates T-SQL grammar rules at the specified location in the batch. This is commonly caused by reserved keywords used as unquoted identifiers (e.g., naming a column “User” or “Order”), mismatched brackets/quotes, or invalid syntax introduced by dynamic SQL string concatenation. In Microsoft SQL Server 2025, this can also surface due to deprecated syntax patterns that are no longer supported by the updated Query Optimizer.

Step-by-Step Resolution Guide

Step 1: Isolate the Offending Query

  • Copy the exact query from the application log or SQL Server Profiler/Extended Events into SQL Server Management Studio (SSMS) 21.
  • Execute the query in isolation to pinpoint the exact line number referenced in the error message.
  • Check the “%.*ls” placeholder in the original error log, as it usually gets replaced by the specific object name or keyword causing the conflict.

Step 2: Check for Reserved Keywords and Special Characters

  • Verify if the identified object (table, column, or variable) uses a T-SQL reserved keyword.
  • Wrap the identifier in square brackets to escape it, for example: SELECT [Order], [User] FROM [dbo].[Sales].
  • Ensure that string literals use single quotes (‘text’) and object identifiers use double quotes or brackets, especially if QUOTED_IDENTIFIER settings were recently changed.

Step 3: Validate Dynamic SQL Construction

  • If the error originates from an application (like a .NET or Python script) building a query string, print the final SQL string before execution using PRINT @SQLString instead of EXEC.
  • Look for missing spaces between concatenated variables (e.g., 'WHERE ID = ' + @ID might render as WHERE ID =5AND Name if not handled correctly).
  • Check for unescaped apostrophes within user-input data that might be terminating a string literal early.

Step 4: Update SQL Server Tools and Drivers

  • Ensure you are using the latest SSMS 21 or Azure Data Studio build to rule out client-side parsing bugs.
  • On Windows Server 2025, navigate to Settings > Windows Update to ensure the OS-level Microsoft ODBC Driver 18/19 for SQL Server is fully patched, as older drivers may mishandle new syntax structures.

Alternative or Verification Steps

  • Verification: Run the corrected script via sqlcmd -S [ServerName] -d [DatabaseName] -i "C:\Scripts\query.sql" to confirm the syntax parses successfully outside of the GUI environment.
  • Alternative: If the query involves a linked server or cross-database call, temporarily simplify the query by removing four-part naming conventions to check if the error is related to the OPENQUERY syntax rather than the local table structure.

How to fix Error 103 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 103 – Identifier/String Length Exceeded

Why This Error Happens

Error 103 occurs when SQL Server 2025 parses a T-SQL batch, stored procedure, or object identifier that exceeds the maximum allowed length, typically because a string literal, variable name, or quoted identifier surpasses the 128-character limit (or the applicable buffer size for the specific object type). This often happens due to dynamically generated SQL scripts, concatenated strings in application code, or migration scripts that construct overly long object names or literals. Corrupted or malformed T-SQL scripts imported from external tools can also introduce excessively long tokens that trigger this parser-level restriction.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query or Script

  • Check the SQL Server Error Log at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the exact statement or batch that triggered Error 103.
  • Use SQL Server Management Studio (SSMS) Activity Monitor or sys.dm_exec_requests to capture the query text via sys.dm_exec_sql_text(sql_handle).
  • Note the specific %.*ls string fragment reported in the error message to locate the long identifier or literal.

Step 2: Shorten the Identifier or String Literal

  • Rename any table, column, variable, or alias exceeding 128 characters to comply with SQL Server’s identifier length limit.
  • If the issue is a string literal (e.g., in dynamic SQL via sp_executesql), break it into smaller concatenated segments or store it in an NVARCHAR(MAX) variable instead of an inline literal.
  • Review application-layer code (ORM frameworks, ETL tools) that dynamically builds SQL strings, ensuring no auto-generated names or parameters exceed length thresholds.

Step 3: Validate and Refactor Dynamic SQL Generation

  • Inspect stored procedures or scripts that use EXEC() or sp_executesql with concatenated strings from loops or metadata queries.
  • Add length-validation logic (LEN()) in your T-SQL to catch oversized strings before execution.
  • Update ETL/migration tools (SSIS, Azure Data Factory, third-party scripts) to enforce identifier length limits during script generation.

Step 4: Rebuild or Re-deploy the Affected Object

  • If the error originates from a corrupted deployment script or DACPAC file, regenerate the script from source control.
  • Re-deploy the object using SSMS or sqlpackage.exe, ensuring the script passes local syntax validation first.
  • Restart the SQL Server service via Services.msc on Windows Server 2025 if the error persists after correcting the script (net stop MSSQLSERVER then net start MSSQLSERVER).

Alternative or Verification Steps

  • Re-run the corrected query or script in SSMS and confirm no Error 103 is raised; check sys.messages to confirm error 103 is not logged in the current session.
  • As a workaround, if the issue lies in third-party generated code, wrap long identifiers in the [ ] bracket syntax and truncate names programmatically before submission to SQL Server.

How to fix Error 1938 on Windows 11

Troubleshooting Guide: Error 1938 – EAS Policy Password Change Required

Why This Error Happens

Error 1938 occurs when Exchange ActiveSync (EAS) policy detects that the user’s domain or account password has expired, been reset by an administrator, or no longer meets policy requirements enforced by the mail server. Windows 11 caches credentials for mail and account sync profiles, and when the server rejects the cached credentials due to a mandatory password change flag, it triggers this logon failure instead of prompting automatically. This typically happens with corrupted credential caches, outdated stored passwords in the Credential Manager, or a mismatch between the local account password and the one recognized by the Exchange/EAS server.

Step-by-Step Resolution Guide

Step 1: Change Your Password on the Native Platform First

  • Log in directly to the associated webmail portal (e.g., Outlook Web Access) or a fully updated desktop client on a browser.
  • Follow the prompts to set a new password that complies with policy (length, complexity, expiration rules).
  • Do not attempt to fix this directly in the Windows Mail app settings first, as it will not force the server-side reset.

Step 2: Clear Cached Credentials in Windows Credential Manager

  • Open Control Panel > User Accounts > Credential Manager.
  • Navigate to the Windows Credentials tab and locate any entries related to your email server or “MicrosoftAccount” tokens tied to the mail app.
  • Select the credential and click Remove.
  • Restart the machine to clear any lingering session tokens.

Step 3: Remove and Re-add the Email Account

  • Go to Settings > Accounts > Email & accounts.
  • Select the problematic account and click Manage, then Delete account from this device.
  • Restart the Mail/Calendar app, click Add account, and enter the newly updated password from Step 1.
  • Ensure “Sync settings” toggles for mail, contacts, and calendar are re-enabled during setup.

Step 4: Verify Group Policy and Sync Settings

  • Open the Run dialog (Win + R) and type gpedit.msc if on Windows 11 Pro/Enterprise.
  • Navigate to Computer Configuration > Administrative Templates > Windows Components > Mail.
  • Confirm no local policies are blocking password prompts or forcing outdated cached logon behavior.

Alternative or Verification Steps

  • To verify the fix, send a test email or manually trigger a sync via Settings > Accounts > Email & accounts > Sync now; a successful sync with no red error banners confirms resolution.
  • If the error persists, boot into Safe Mode with Networking, remove the account entirely, and rebuild the mail profile from scratch to rule out a corrupted local cache file.

How to fix Error 1939 on Windows 11

Why This Error Happens

Error 1939 typically occurs when Windows 11’s cached credentials for a linked Microsoft Entra ID (Azure AD) or work/school account become desynchronized with the domain controller, often due to a broken trust relationship. This can also happen if Group Policy settings enforce Windows Hello for Business or a Conditional Access policy that requires network validation before allowing sign-in. Additionally, corrupted local security authority (LSA) cache files or an expired device certificate can trigger this restriction as a protective measure.

Step-by-Step Resolution Guide

Step 1: Verify Network Connectivity and Domain Reachability

  • Ensure the device has an active Ethernet or Wi-Fi connection, since this error explicitly requires internet access to validate credentials.
  • Open Command Prompt and run ping login.microsoftonline.com to confirm the authentication endpoint is reachable.
  • If on a corporate VPN, disconnect and reconnect to refresh the network session before attempting sign-in again.

Step 2: Have the Administrator Account Sign In First

  • As instructed by the error message, log in using the designated administrator or global admin account first to refresh the domain trust token.
  • Navigate to Settings > Accounts > Access work or school and confirm the admin account shows as “Connected.”
  • This action forces Windows to re-validate the Conditional Access policy cache for subsequent standard users.

Step 3: Clear Cached Credentials via Credential Manager

  • Press Win + R, type control keymgr.dll, and press Enter to open Credential Manager.
  • Under Windows Credentials, remove any entries labeled MicrosoftAccount:user= or Enterprise that show a red “X” or error icon.
  • Restart the device to force Windows to request fresh credentials from the domain controller.

Step 4: Check and Repair the Trust Relationship

  • Open PowerShell as Administrator and run Test-ComputerSecureChannel -Verbose to check if the machine account trust is broken.
  • If the command returns False, run Test-ComputerSecureChannel -Repair -Credential (Get-Credential) and enter valid domain admin credentials.
  • Reboot the machine to apply the restored secure channel.

Step 5: Review Group Policy for Sign-In Restrictions

  • Run gpupdate /force in Command Prompt to ensure the device has the latest policy settings from the server.
  • Navigate to Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options in gpedit.msc and check for restrictive “Interactive Logon” policies.
  • Consult with the IT department to verify if a Conditional Access policy is blocking non-compliant devices.

Alternative or Verification Steps

  • Verification: After the admin account signs in successfully, log out and attempt to sign in with the standard user account; the 1939 error prompt should no longer appear.
  • Alternative: If the error persists, boot into Safe Mode with Networking, sign in with the local administrator account, and disjoin/rejoin the device to the Entra ID or Active Directory domain to reset the trust relationship entirely.

How to fix Error 2000 on Windows 11

Troubleshooting Guide: Error 2000 – Invalid Pixel Format (Windows 11)

Why This Error Happens

Error 2000 typically occurs when the display driver fails to negotiate a valid pixel format with the application requesting a rendering context, often due to an outdated, corrupted, or mismatched GPU driver. This can also result from corrupted DirectX/OpenGL component files or conflicting graphics settings introduced after a Windows update. In some cases, third-party overlay software (such as capture tools or overclocking utilities) interferes with the graphics pipeline, causing the pixel format request to fail.

Step-by-Step Resolution Guide

Step 1: Update or Reinstall the Graphics Driver

  • Open Device Manager by right-clicking the Start menu and selecting it.
  • Expand Display adapters, right-click your GPU, and select Uninstall device.
  • Check the box for Attempt to remove the driver software for this device, then restart your PC.
  • Download the latest driver directly from NVIDIA, AMD, or Intel’s official website and install it manually.

Step 2: Verify and Repair DirectX Components

  • Press Windows + R, type dxdiag, and press Enter to open the DirectX Diagnostic Tool.
  • Check the Display tab for any listed errors regarding drivers or notes.
  • Run sfc /scannow in an elevated Command Prompt to repair corrupted system files that may affect rendering libraries.
  • Restart your PC after the scan completes.

Step 3: Disable Conflicting Overlay Software

  • Close background applications like Discord, GeForce Experience, RivaTuner, or OBS Studio that inject overlays into rendering contexts.
  • Navigate to Settings > Apps > Startup and disable any unnecessary overlay-related apps from launching automatically.
  • Relaunch the affected application to see if the error persists.

Step 4: Reset Graphics Settings via Windows Settings

  • Go to Settings > System > Display > Graphics.
  • Click on the affected application and select Options, then reset it to Let Windows Decide instead of a manually forced high-performance or power-saving mode.
  • Restart the application to apply the updated pixel format handling.

Alternative or Verification Steps

  • To verify the fix, reopen the application that triggered Error 2000 and check if it launches into the rendering window without crashing or throwing the pixel format error.
  • If the issue persists, try performing a Windows Update check (Settings > Windows Update) to ensure no pending OS patches are causing a driver-API mismatch, then retest the application.

How to fix Error 21 on Windows Server 2025 / Windows 11

Why This Error Happens

Error 21 in SQL Server represents a severity-level fatal error, indicating that SQL Server has encountered a critical problem affecting the current database or session, often due to system table corruption, insufficient memory allocation, or a failing I/O subsystem. This error frequently surfaces when the SQL Server service account lacks proper permissions on database files, or when Windows Server 2025 disk write-caching settings conflict with SQL Server’s transaction logging requirements. In some cases, this is triggered by an incompatible or outdated storage driver interacting poorly with SQL Server 2025’s enhanced memory management features.

Step-by-Step Resolution Guide

Step 1: Check SQL Server Error Logs for Root Cause

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG
  • Open the most recent log file and search for entries immediately preceding “Error: 21” to identify the specific subsystem (I/O, memory, or tempdb) that triggered the fault.
  • Run EXEC sp_readerrorlog 0, 1, 'Error: 21' in SSMS to filter directly within the database engine.

Step 2: Verify Service Account Permissions and Database File Integrity

  • Open Services.msc, locate “SQL Server (MSSQLSERVER)”, and confirm the Log On account has Full Control over the data directory (typically C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA).
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS to scan for physical corruption in the affected database.
  • If corruption is found, restore from the last known good backup rather than using repair options that may cause data loss.

Step 3: Update Storage Drivers and Adjust Memory Configuration

  • Go to Device Manager > Disk Drives, right-click your storage controller, and select Update Driver to ensure compatibility with Windows Server 2025.
  • In SSMS, right-click the server instance, select Properties > Memory, and verify “Maximum Server Memory” is not set higher than available physical RAM, which can trigger fatal severity errors under load.
  • Restart the SQL Server service via net stop MSSQLSERVER followed by net start MSSQLSERVER to apply changes.

Step 4: Re-run Windows Updates and SQL Server Cumulative Updates

  • Open Settings > Windows Update and install any pending OS-level patches for Windows Server 2025.
  • Download and apply the latest Cumulative Update (CU) for SQL Server 2025 from the Microsoft Download Center to resolve any known engine-level bugs tied to Error 21.

Alternative or Verification Steps

  • After applying fixes, monitor the ERRORLOG for 24–48 hours and confirm no new “Error: 21” entries appear during peak database load.
  • If the error persists, run SQL Server Configuration Manager to rebuild the tempdb database files, as a corrupted tempdb is a common alternative cause of this fatal error.

How to fix Error 1935 on Windows 11

Why This Error Happens

This error occurs because of Windows’ Authentication Firewall, a security feature tied to Active Directory Domain Services (AD DS) that restricts which computers a specific user account is allowed to log into. It typically triggers when an administrator has configured “Logon Workstation” restrictions on the user account, or when Kerberos armoring (FAST) policies conflict with the client machine’s Group Policy settings. In non-domain environments, this can also surface due to corrupted local security policy caches or misconfigured Network Level Authentication (NLA) settings on Remote Desktop connections.

Step-by-Step Resolution Guide

Step 1: Verify Logon Workstation Restrictions in Active Directory

  • Open Active Directory Users and Computers (ADUC) on a domain controller.
  • Navigate to the user’s account properties, click the Account tab, and select Logon To…
  • Ensure the target Windows 11 machine’s NetBIOS name is explicitly listed, or select “All computers” to remove the restriction.

Step 2: Check Group Policy for Authentication Silos and Kerberos Armoring

  • Run gpresult /h report.html on the affected machine to identify applied policies.
  • Navigate to Computer Configuration > Administrative Templates > System > Kerberos and check if “Kerberos client support for claims, compound authentication, and Kerberos armoring” is enabled but misconfigured.
  • If the machine is part of an Authentication Policy Silo, verify the silo membership matches the correct organizational unit (OU) in ADUC under Attribute Editor.

Step 3: Clear Cached Credentials and Kerberos Tickets

  • Open Command Prompt as Administrator and run:
  klist purge
  • Restart the Netlogon service via services.msc or by running:
  net stop netlogon && net start netlogon
  • Reboot the Windows 11 machine to force a fresh Kerberos ticket request.

Step 4: Reset the Computer Account Trust Relationship

  • Disjoin the Windows 11 machine from the domain via Settings > Accounts > Access work or school.
  • Restart the PC, then rejoin the domain using valid domain admin credentials.
  • Confirm the computer object is re-created correctly in the correct OU within ADUC.

Alternative or Verification Steps

  • After applying fixes, attempt to log in with the affected account again; if successful, run whoami /groups to confirm the correct security tokens and OU memberships are applied.
  • If the issue persists, temporarily disable NLA on the Remote Desktop connection (System Properties > Remote Desktop > Advanced settings) to isolate whether the firewall restriction is RDP-specific rather than a domain-wide policy issue.

How to fix Error 1936 on Windows 11

Troubleshooting Guide: Error 1936 – Print Spooler Remote Connections Blocked by Policy

Why This Error Happens

This error occurs because the RpcAuthnLevelPrivacyEnabled policy or related Group Policy security settings are restricting remote procedure calls (RPC) to the Print Spooler service. Microsoft tightened these defaults after the PrintNightmare vulnerability patches, causing many systems to block remote print connections by default. Additionally, corrupted spooler configurations or missing registry keys tied to Point and Print Restrictions can trigger this behavior even on trusted networks.

Step-by-Step Resolution Guide

Step 1: Verify Print Spooler Service Status

  • Press Win + R, type services.msc, and press Enter.
  • Locate Print Spooler in the list and confirm the status is “Running.”
  • Right-click and select Restart to clear any temporary service conflicts.

Step 2: Modify Group Policy for RPC Authentication

  • Open gpedit.msc (Local Group Policy Editor).
  • Navigate to Computer Configuration > Administrative Templates > Printers.
  • Locate “Allow Print Spooler to accept client connections” and set it to Enabled.
  • Run gpupdate /force in Command Prompt (Admin) to apply changes immediately.

Step 3: Adjust Registry Permissions for Point and Print

  • Open regedit and navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint
  • Set RestrictDriverInstallationToAdministrators to 0 if remote users need standard access.
  • Create or modify the DWORD NoWarningNoElevationOnInstall and set the value to 1 to prevent elevation prompts blocking the connection.

Step 4: Confirm RPC Authentication Level Registry Key

  • Navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\RPC
  • Ensure RpcAuthnLevelPrivacyEnabled is set to 0 (Disabled) if you need to allow legacy remote spooler connections, understanding this reduces security hardening.
  • Reboot the machine to ensure the RPC service reloads the new authentication level.

Alternative or Verification Steps

  • Verify the fix: Attempt the remote print connection again; if successful, check the Event Viewer under Applications and Services Logs > Microsoft > Windows > PrintService to confirm no new Error 1936 entries appear.
  • Alternative: If registry edits fail to resolve the block, use the Local Security Policy editor (secpol.msc) to check for conflicting Network security restrictions under Local Policies > Security Options that might override the Group Policy changes made in Step 2.

How to fix Error 1937 on Windows 11

Troubleshooting Guide: Error 1937 – NTLM Authentication Disabled

Why This Error Happens

This error occurs because Windows 11 has Network Security policies configured to restrict or completely disable NTLM authentication, typically through Group Policy settings (Network security: Restrict NTLM policies). This is often intentional in enterprise environments for security hardening, but it breaks authentication for legacy applications, older network shares, or services that still rely exclusively on NTLM rather than Kerberos. Additionally, a misconfigured Local Security Policy or a domain-level GPO pushed from a controller can inadvertently disable NTLM even on systems that require it for specific connections.

Step-by-Step Resolution Guide

Step 1: Check Local Security Policy Settings

  • Press Win + R, type secpol.msc, and hit Enter.
  • Navigate to Local Policies > Security Options.
  • Look for entries starting with Network security: Restrict NTLM.
  • Verify if any of these are set to “Deny All” or similarly restrictive values.

Step 2: Modify NTLM Restriction Policies

  • Locate Network security: Restrict NTLM: NTLM authentication in this domain.
  • Change the value from “Deny All” to “Allow all” or “Not Defined” depending on your organizational needs.
  • Also check Network security: Restrict NTLM: Incoming NTLM traffic and set it to “Allow all accounts” if blocking is not required.
  • Click Apply and OK to save changes.

Step 3: Update Group Policy via Registry (If GPO is Enforced)

  • Press Win + R, type regedit, and hit Enter.
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0.
  • Locate the RestrictReceivingNTLMTraffic and RestrictSendingNTLMTraffic DWORD values.
  • Set these values to 0 (Allow All) if you need to re-enable NTLM traffic.
  • Restart the machine for changes to take effect.

Step 4: Force Group Policy Refresh

  • Open Command Prompt as Administrator.
  • Run the command: gpupdate /force
  • Wait for the policy update to complete, then restart the system if prompted.

Alternative or Verification Steps

  • To verify the fix, attempt the original authentication process (e.g., mapping a network drive or logging into the legacy application) again to confirm the “Error 1937” no longer appears.
  • If the issue persists and NTLM must remain disabled for security compliance, consider migrating the affected application or service to support Kerberos authentication instead, as re-enabling NTLM broadly is generally discouraged for long-term security posture.

How to fix Error 1932 on Windows 11

Troubleshooting Guide: Error 1932 – Delegated Trust Creation Quota Exceeded

Why This Error Happens

This error occurs when a computer account attempts to create more Active Directory trust objects than permitted by the ms-DS-MachineAccountQuota attribute, which by default limits domain-joined workstations to a specific number of computer object creations. This is commonly triggered on Windows 11 machines during domain rejoin operations, certain VPN/RRAS configurations, or when Active Directory Federation Services (AD FS) attempts to establish delegated trusts beyond the quota assigned to the requesting user account. The underlying cause is almost always a permissions or quota restriction set at the domain level, rather than a local file corruption issue.

Step-by-Step Resolution Guide

Step 1: Check the Current Machine Account Quota

  • Open Command Prompt as Administrator and run: dsquery * domainroot -attr ms-DS-MachineAccountQuota
  • Confirm whether the value is set to 0, which explicitly blocks all new object/trust creation for standard users.
  • Note the current domain controller you are querying against, as replication delays can cause inconsistent quota values.

Step 2: Increase or Reset the Quota via Active Directory

  • Open Active Directory Users and Computers (ADUC) or use ADSI Edit on a Domain Controller.
  • Navigate to the Domain root object, right-click, select Properties, and locate the ms-DS-MachineAccountQuota attribute.
  • Set the value higher (e.g., 10) using this PowerShell command on the DC: Set-ADDomain -Identity "yourdomain.com" -Replace @{"ms-DS-MachineAccountQuota"="10"}

Step 3: Grant Explicit “Create Computer Objects” Permission

  • If quota adjustments are restricted by policy, delegate specific permissions instead of relying on the global quota.
  • In ADUC, right-click the target Organizational Unit (OU) and select Delegate Control.
  • Assign the affected user or service account the Create Computer Objects permission directly on that OU.

Step 4: Clear Local Cached Credentials on the Windows 11 Client

  • On the affected Windows 11 machine, open Settings > Accounts > Access work or school.
  • Remove the connection, restart the machine, and re-establish the connection to force a fresh token request that respects the updated quota.
  • Alternatively, run klist purge in Command Prompt to clear stale Kerberos tickets that may be enforcing the old quota limit.

Alternative or Verification Steps

  • Verify the Fix: Attempt the trust creation action again (e.g., rejoining the domain or establishing the AD FS trust) and check the Event Viewer under Applications and Services Logs > Directory Service to confirm Error 1932 no longer appears.
  • Alternative Fix: If domain-level quota changes are not permitted due to security policy, have a Domain Admin manually pre-stage the computer object in AD before the join attempt, bypassing the need for the quota entirely.

How to fix Error 1933 on Windows 11

Troubleshooting Guide: Error 1933 – Delegated Trust Creation Quota Exceeded

Why This Error Happens

Error 1933 typically occurs in Active Directory environments when a computer or user account attempts to create more delegated trust objects (such as machine account joins or trust relationships) than allowed by the ms-DS-MachineAccountQuota attribute. This quota, which defaults to 10 in most AD configurations, limits how many computer accounts a single non-administrative user can create in the domain. Once this threshold is reached, Windows 11 blocks further domain-join or trust-creation attempts, even if the underlying permissions would otherwise allow it.

Step-by-Step Resolution Guide

Step 1: Verify the Current Machine Account Quota

  • Open Command Prompt or PowerShell with administrative privileges.
  • Run the following command to check the current quota value:
  dsquery * -filter (objectClass=domainDNS) -attr ms-DS-MachineAccountQuota
  • Confirm whether the returned value is set to 0 or a low number (e.g., 10), which indicates the quota has likely been exhausted.

Step 2: Increase or Reset the Quota via Active Directory

  • Open ADSI Edit (adsiedit.msc) on a domain controller.
  • Navigate to Domain [yourdomain.com], right-click the domain root, and select Properties.
  • Locate the ms-DS-MachineAccountQuota attribute and increase its value (e.g., from 10 to 50) or set it to 0 temporarily to disable the restriction for testing.
  • Click Apply and OK to save changes.

Step 3: Remove Stale or Unused Computer Objects

  • Open Active Directory Users and Computers (ADUC) on the domain controller.
  • Sort the Computers OU by “Last Logon” date to identify inactive or orphaned machine accounts.
  • Delete stale computer objects that are no longer in use, as these count against the creating user’s quota.
  • Re-attempt the domain join or trust creation operation on the Windows 11 client.

Step 4: Delegate Explicit Permissions Instead of Using Quota

  • In ADUC, right-click the target Organizational Unit (OU) and select Delegate Control.
  • Add the specific user or group account performing the join/trust operation.
  • Assign the permission “Create Computer Objects” explicitly, bypassing reliance on the default quota system entirely.

Alternative or Verification Steps

  • Re-run the domain join or trust creation command (e.g., Add-Computer in PowerShell) and confirm Error 1933 no longer appears in Event Viewer under Windows Logs > System.
  • If the issue persists, use Get-ADUser [username] -Properties msDS-MachineAccountQuota in PowerShell (RSAT tools required) to confirm the updated quota has replicated across all domain controllers.

How to fix Error 1934 on Windows 11

Why This Error Happens

Error 1934 occurs when Active Directory Domain Services enforces a tombstone quota, limiting how many objects a specific security principal (trustee) is allowed to own or delete within a given naming context or partition. When a user or service account attempts to delete a trust object (such as a domain/forest trust) and their allotted quota of deletions has already been consumed, AD DS blocks the operation and returns this error. This is not a corruption issue—it is a deliberate governance limit stored in the Quotas container of the Configuration or Domain partition, typically defined by the msDS-QuotaAmount and msDS-QuotaTrustee attributes.

Step-by-Step Resolution Guide

Step 1: Identify the Current Quota Assigned to the User

  • Open ADSI Edit (adsiedit.msc) with an account that has Domain Admin or Enterprise Admin rights.
  • Connect to the Configuration naming context, then navigate to:
    CN=Configuration,DC=YourDomain,DC=com > CN=Services > CN=NTDS Quotas
  • Locate the object matching the affected user’s SID under msDS-QuotaTrustee.
  • Note the current value of msDS-QuotaAmount — this is the maximum number of objects the user can own/delete.

Step 2: Increase or Remove the Quota Restriction

  • In ADSI Edit, right-click the relevant quota object and select Properties.
  • Modify msDS-QuotaAmount to a higher value (e.g., increase from 1 to 100), or set it to a very large number to effectively disable the restriction for that trustee.
  • Alternatively, use PowerShell to adjust the quota directly:
  Set-ADObject -Identity "CN=<QuotaObjectName>,CN=NTDS Quotas,CN=Configuration,DC=YourDomain,DC=com" -Replace @{msDS-QuotaAmount="100"}
  • Click Apply, then OK to save changes.

Step 3: Assign a Default Quota if None Exists

  • If no specific quota object exists for the user, AD DS falls back to the default quota for the partition, defined by msDS-DefaultQuota on the Quotas container.
  • Check and raise this default value using:
  Set-ADObject -Identity "CN=NTDS Quotas,CN=Configuration,DC=YourDomain,DC=com" -Replace @{msDS-DefaultQuota="50"}
  • Ensure this change is replicated to all Domain Controllers before retrying the trust deletion.

Step 4: Retry the Trust Deletion Operation

  • Reopen Active Directory Domains and Trusts on the Windows 11 management machine (via RSAT).
  • Attempt to delete the trust relationship again under Domain Trusts properties.
  • Confirm the operation completes without triggering Error 1934.

Alternative or Verification Steps

  • Run dcdiag /test:services and check Event Viewer under Directory Service logs to confirm no further msDS-QuotaAmount violations are recorded after the change.
  • If quota edits do not resolve the issue, log on with a Domain Admin account (which bypasses trustee-based quotas entirely) and perform the trust deletion from that elevated context instead.

How to fix Error 1929 on Windows 11

Why This Error Happens

Error 1929 typically occurs when the Windows Group Policy or local security group configuration references a group element that has an active dependency, such as being tied to a login session, service account, or Active Directory sync process. This can also result from insufficient administrative permissions or a corrupted Security Accounts Manager (SAM) database entry that prevents clean removal of the group object. In some cases, residual registry keys from a previous uninstall or policy push leave the group element “locked” even though the parent application appears removed.

Step-by-Step Resolution Guide

Step 1: Verify Administrative Privileges and Close Conflicting Sessions

  • Right-click the Start menu and select “Windows Terminal (Admin)” or “Command Prompt (Admin)” to ensure you have elevated rights.
  • Run net localgroup to confirm the group in question is visible and check for active user sessions tied to it via query user.
  • Log off any users currently mapped to that group before attempting removal again.

Step 2: Use PowerShell to Force Remove the Group Element

  • Open PowerShell as Administrator.
  • Run Get-LocalGroup -Name "GroupNameHere" to confirm the object exists and retrieve its SID.
  • If it exists, force removal using Remove-LocalGroup -Name "GroupNameHere" -Confirm:$false.
  • If the command returns Error 1929 again, proceed to registry cleanup in Step 3.

Step 3: Clean Up Residual Registry and SAM References

  • Press Win + R, type regedit, and navigate to HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Builtin\Aliases.
  • Locate the subkey matching the group’s SID (cross-reference using wmic group get name,sid in Command Prompt).
  • Back up the key by right-clicking and selecting “Export,” then delete the corrupted alias entry.
  • Restart the machine to allow the Security Accounts Manager to rebuild its cache.

Step 4: Run System File and Group Policy Repair Tools

  • Open Command Prompt as Administrator and run sfc /scannow to repair any corrupted system files affecting the SAM database.
  • Follow this with DISM /Online /Cleanup-Image /RestoreHealth to ensure the Windows image itself is not corrupted.
  • Once complete, retry removing the group element using net localgroup GroupNameHere /delete.

Alternative or Verification Steps

  • After completing the steps above, verify the fix by running Get-LocalGroup in PowerShell and confirming the group no longer appears in the output list.
  • If the error persists, use the Local Users and Groups MMC snap-in (lusrmgr.msc) to manually inspect and delete the group through the GUI, as this sometimes bypasses command-line permission caching issues.

How to fix Error 1930 on Windows 11

Why This Error Happens

Error 1930 occurs because Windows 11 detects that the printer driver you are attempting to install is a legacy “Kernel Mode” driver (commonly associated with NT 4.0 architecture). A Group Policy setting named “Disallow installation of printers using kernel-mode drivers” is enabled on the system, which explicitly blocks these outdated drivers to protect the OS from instability and security vulnerabilities. Since Windows 11 only supports User Mode drivers natively, this policy conflict halts the installation process immediately.

Step-by-Step Resolution Guide

Step 1: Check the Local Group Policy Editor

  • Press Win + R, type gpedit.msc, and hit Enter.
  • Navigate to Computer Configuration > Administrative Templates > Printers.
  • Locate the policy named “Disallow installation of printers using kernel-mode drivers.”
  • Ensure this is set to Disabled or Not Configured (Note: If your machine is on a domain, an Administrator may need to adjust this at the Domain Controller level via GPO).

Step 2: Update the Registry (For Non-Domain/Home Devices)

  • If Group Policy Editor is unavailable (common on Windows 11 Home), press Win + R and type regedit.
  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers.
  • Find the DWORD value named DisallowKMDrivers.
  • Change the value data from 1 to 0, then click OK and restart the PC.

Step 3: Download the Correct Driver Type

  • Visit the printer manufacturer’s website (e.g., HP, Canon, Epson) and search for the specific model.
  • Ensure you select a driver explicitly labeled “V4” or “User Mode” compatible with Windows 11, rather than a generic “Universal” or legacy driver package.
  • Uninstall the old driver package via Settings > Apps > Installed Apps before installing the new file.

Step 4: Clear the Print Spooler Cache

  • Open the Services app (services.msc).
  • Right-click Print Spooler and select Stop.
  • Navigate to C:\Windows\System32\spool\PRINTERS and delete all files inside this folder.
  • Restart the Print Spooler service and attempt the driver installation again.

Alternative or Verification Steps

  • Verification: Go to Control Panel > Devices and Printers, right-click the installed printer, select Printer Properties > Advanced, and confirm the driver listed is a “Type 3 – User Mode” driver rather than “Type 2 – Kernel Mode.”
  • Alternative: If the manufacturer only provides a Kernel Mode driver for legacy hardware, use the built-in Windows “Generic / Text Only” or “Microsoft IPP Class Driver” as a temporary workaround to establish connectivity.

How to fix Error 1931 on Windows 11

Troubleshooting Guide: Error 1931 – “The Context Has Expired and Can No Longer Be Used”

Why This Error Happens

Error 1931 typically occurs during Windows domain join operations or Active Directory-related tasks when the security context (Kerberos ticket or authentication token) times out before the operation completes. This is often caused by clock synchronization issues between the client machine and the domain controller, slow network latency during authentication handshakes, or a stale cached credential that was not refreshed properly. In some cases, corrupted NETLOGON channel data or an interrupted LDAP session can also trigger this expiration prematurely.

Step-by-Step Resolution Guide

Step 1: Synchronize the System Clock

  • Open Settings > Time & Language > Date & Time.
  • Ensure “Set time automatically” is toggled ON.
  • Manually force a sync by opening Command Prompt as Administrator and running: w32tm /resync /force
  • Verify the time difference between your local machine and the domain controller is under 5 minutes (Kerberos requires this by default).

Step 2: Clear Cached Credentials and Kerberos Tickets

  • Open Command Prompt as Administrator.
  • Run klist purge to clear all cached Kerberos tickets.
  • Restart the Netlogon service by running: net stop netlogon followed by net start netlogon.
  • Reboot the machine to ensure a fresh authentication context is established on the next login.

Step 3: Rejoin the Domain or Reset the Secure Channel

  • Open PowerShell as Administrator.
  • Run Test-ComputerSecureChannel -Repair to attempt an automatic repair of the trust relationship.
  • If the repair fails, remove the machine from the domain, reboot into a local admin account, and rejoin the domain via Settings > Accounts > Access work or school > Connect.

Step 4: Check Network Stability During Authentication

  • Use ping <DomainControllerIP> -t to check for packet loss during the authentication window.
  • Ensure ports 88 (Kerberos), 389 (LDAP), and 445 (SMB) are not blocked by local firewall rules under Windows Defender Firewall > Advanced Settings.

Alternative or Verification Steps

  • Verify the fix: Attempt the original action (domain join, GPO update, or authentication request) again and confirm no Error 1931 pop-up appears; check Event Viewer under Applications and Services Logs > Directory Service for a corresponding success entry.
  • Alternative fix: If the error persists, try running gpupdate /force to refresh Group Policy contexts, or use a different network connection (wired instead of Wi-Fi) to rule out latency-induced token expiration.

How to fix Error 1926 on Windows 11

Why This Error Happens

Error 1926 typically occurs when Windows fails to write or merge a new user profile element into the registry, often due to insufficient permissions on the profile directory or registry hive. This can also result from a corrupted user profile, damaged NTUSER.DAT file, or conflicts caused by third-party security software blocking profile creation. In enterprise environments, Group Policy misconfigurations related to roaming or mandatory profiles can also trigger this error.

Step-by-Step Resolution Guide

Step 1: Verify Account Permissions

  • Log in as an Administrator and navigate to C:\Users\[Username].
  • Right-click the folder, select Properties > Security, and ensure the affected user has Full Control.
  • Apply changes and restart the machine to force a profile reload.

Step 2: Check and Repair the Registry Profile List

  • Press Win + R, type regedit, and navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  • Look for duplicate or corrupted SID entries (folders ending in .bak).
  • Rename the corrupted key by adding .ba at the end temporarily, then reboot to allow Windows to regenerate the profile.

Step 3: Run System File and DISM Scans

  • Open Command Prompt as Administrator.
  • Execute sfc /scannow to repair corrupted system files.
  • Follow up with DISM /Online /Cleanup-Image /RestoreHealth to fix the underlying Windows image.

Step 4: Disable Third-Party Antivirus Temporarily

  • Navigate to Settings > Privacy & Security > Windows Security.
  • Temporarily disable third-party endpoint protection or firewall software.
  • Attempt the profile action again to see if the security software was blocking the registry write.

Alternative or Verification Steps

  • To verify the fix, create a brand new local user account via Settings > Accounts > Other users and confirm it logs in without generating Error 1926.
  • If the error persists, consider creating a new user profile entirely and manually migrating data (Desktop, Documents, Downloads) from the old profile folder to the new one.

How to fix Error 1927 on Windows 11

Troubleshooting Guide: Error 1927 — “The Specified Profile Element Could Not Be Removed”

Why This Error Happens

Error 1927 typically occurs during the uninstallation or repair of an application when the Windows Installer service attempts to remove a user-specific registry profile entry but lacks sufficient permissions to do so. This is often caused by corrupted user profile registry hives, insufficient administrative rights on the current session, or leftover registry keys from a previous incomplete uninstallation. In some cases, third-party security software or Group Policy restrictions can also block the Windows Installer from modifying protected registry paths.

Step-by-Step Resolution Guide

Step 1: Run the Installer with Elevated Administrative Rights

  • Right-click the installer or setup.exe file and select “Run as administrator.”
  • If the error occurs during an automated uninstall, open Command Prompt as Administrator and re-run the uninstall command manually.
  • Verify your account has full local Administrator privileges via Settings > Accounts > Your Info.

Step 2: Check and Repair Registry Permissions

  • Open the Registry Editor by typing regedit in the Start menu and running as Administrator.
  • Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Installer\UserData.
  • Right-click the relevant product key folder, select “Permissions,” and ensure “Administrators” and “SYSTEM” have Full Control.
  • Apply changes and attempt the removal process again.

Step 3: Use the Microsoft Program Install and Uninstall Troubleshooter

  • Download the official troubleshooter tool from the Microsoft Support website.
  • Run the tool and select the application that is failing to uninstall/repair.
  • Allow the tool to automatically detect and fix corrupted registry references tied to the profile element.

Step 4: Clear the Windows Installer Cache

  • Navigate to C:\Windows\Installer in File Explorer (you may need to unhide this folder via View settings).
  • Do not delete files directly; instead, use the Disk Cleanup utility (search “cleanmgr” in Start) and select “Clean up system files” to safely clear orphaned installer cache data.
  • Restart your PC and attempt the profile removal or installation process again.

Alternative or Verification Steps

  • Verification: Open Event Viewer (eventvwr.msc), navigate to Windows Logs > Application, and confirm that no new Error 1927 entries appear after re-running the installation/removal process.
  • Alternative: If the error persists, create a new local user profile via Settings > Accounts > Other Users, log in to the new profile, and attempt the installation/removal from there to rule out a corrupted user-specific profile.

How to fix Error 1928 on Windows 11

Why This Error Happens

Error 1928 typically occurs during a Windows Installer (MSI) operation when the system attempts to register a Group Policy extension and fails. This is often caused by corrupted Group Policy Client Side Extensions (CSEs) in the registry, insufficient administrative permissions, or a damaged Windows Installer service that cannot properly write to the required registry hives. In some cases, third-party antivirus software may also block the registration process, triggering this failure.

Step-by-Step Resolution Guide

Step 1: Run the Installation as Administrator

  • Right-click the installer file and select “Run as administrator” to bypass permission restrictions.
  • Ensure your current Windows account has full Administrator rights, not just a Standard User profile.
  • If using a corporate device, verify Local Group Policy isn’t restricting installer permissions via gpedit.msc.

Step 2: Repair the Windows Installer Service

  • Open Command Prompt as Administrator and run msiexec /unregister, followed by msiexec /regserver to reset the installer engine.
  • Restart the “Windows Installer” service via services.msc to ensure it is running under the Local System account.
  • Clear any stuck installer cache files located in C:\Windows\Installer (back up first before deleting).

Step 3: Reset Group Policy Client Side Extensions

  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions in the Registry Editor (regedit).
  • Check for any corrupted or duplicate GUID entries related to the failing group element and remove invalid keys.
  • Restart the machine to force Windows to rebuild the GPO extension cache on next boot.

Step 4: Temporarily Disable Third-Party Antivirus

  • Pause real-time protection for third-party security software (e.g., McAfee, Norton) during the install attempt.
  • Re-run the installer to see if the security suite was intercepting the registry write operation.
  • Re-enable antivirus immediately after the installation completes successfully.

Alternative or Verification Steps

  • Verify: Open Event Viewer (eventvwr.msc) and check the Application log for Event ID 1928 to confirm it no longer appears after a fresh install attempt.
  • Alternative: If the error persists, use the built-in Windows System File Checker by running sfc /scannow in an elevated Command Prompt to repair underlying corrupted system files that may be blocking the Group Policy registration.

How to fix Error 1923 on Windows 11

Why This Error Happens

Error 1923 typically occurs when a Windows service fails to install or start due to insufficient account permissions, particularly when the service is tied to a specific user account that lacks the “Log on as a service” right. In the context of “Not all object UUIDs could be exported to the specified entry,” this points to a breakdown in the RPC (Remote Procedure Call) registration process, often caused by corrupted registry entries or a mismatch between the service’s security context and Active Directory/local security policy. Third-party antivirus or Group Policy restrictions can also block the UUID export process, preventing the service from registering correctly with the Service Control Manager.

Step-by-Step Resolution Guide

Step 1: Verify Account Permissions and Service Logon Rights

  • Open the Local Security Policy editor by typing secpol.msc into the Windows 11 search bar.
  • Navigate to Security Settings > Local Policies > User Rights Assignment.
  • Locate “Log on as a service” and ensure the account attempting to run the affected application/service is listed.
  • If missing, click Add User or Group, input the account name, and apply the changes.

Step 2: Repair Corrupted Registry Entries via System File Checker

  • Open Command Prompt as Administrator (right-click Start Menu > Terminal (Admin)).
  • Run the System File Checker to scan for corrupted system files: sfc /scannow
  • Once complete, run the Deployment Image Servicing and Management tool to repair the Windows image: DISM /Online /Cleanup-Image /RestoreHealth
  • Restart the machine to apply repairs.

Step 3: Re-register the Service Using Correct Credentials

  • Open Services (services.msc) and locate the specific application service causing the 1923 error.
  • Right-click the service, select Properties, and go to the Log On tab.
  • Switch the “Log on as” setting from Local System account to This account, and manually input a valid Administrator username and password.
  • Click Apply, then attempt to start the service manually to see if the UUID export completes.

Step 4: Check Group Policy and Firewall Restrictions

  • Open the Group Policy Editor (gpedit.msc) and check under Computer Configuration > Windows Settings > Security Settings for any restrictive RPC policies.
  • Temporarily disable third-party antivirus/firewall software to rule out interference with RPC communication.
  • Retry the installation or service start-up process to see if the UUID export error persists.

Alternative or Verification Steps

  • Verification: Open Event Viewer (eventvwr.msc), navigate to Windows Logs > System, and filter for Event ID 1923 to confirm the specific service no longer throws the error upon restart.
  • Alternative: If the error persists, use the built-in sc.exe command in Command Prompt (Admin) to manually delete and reconfigure the specific service entry: sc delete [ServiceName] followed by a clean reinstall of the software package.

How to fix Error 1924 on Windows 11

Why This Error Happens

Error 1924 typically occurs when the Windows Installer (MSI) service attempts to register a COM interface or type library during setup but fails to write the corresponding entry into the registry. This is most commonly caused by insufficient administrative permissions on the registry hive (HKEYCLASSESROOT or HKEYLOCALMACHINE), a corrupted or locked registry key from a previous failed installation, or interference from third-party antivirus/security software blocking registry writes. In some cases, a damaged Windows Installer cache or an incomplete .NET Framework component can also trigger this failure.

Step-by-Step Resolution Guide

Step 1: Run the Installer with Elevated Administrator Rights

  • Right-click the installer executable or MSI package and select “Run as administrator.”
  • If launching via Command Prompt, ensure the prompt itself is opened as Administrator (Win + X > Terminal (Admin)).
  • Confirm your Windows account has full Administrator privileges under Settings > Accounts > Family & other users.

Step 2: Check and Repair Registry Permissions

  • Open regedit and navigate to HKEY_CLASSES_ROOT\Interface.
  • Right-click the key, select Permissions, and ensure “Administrators” and “SYSTEM” have Full Control.
  • If the key appears locked or missing sub-entries, use “Advanced” > “Change Owner” to take ownership before modifying permissions.

Step 3: Clear the Windows Installer Cache

  • Open File Explorer and navigate to C:\Windows\Installer.
  • Do not delete files directly; instead, run the Microsoft Program Install and Uninstall Troubleshooter to safely clear corrupted MSI cache entries.
  • Restart the system after the troubleshooter completes.

Step 4: Temporarily Disable Third-Party Antivirus

  • Open your antivirus dashboard and disable real-time protection temporarily.
  • Re-run the installer to see if the security software was blocking registry writes.
  • Re-enable antivirus protection immediately after installation completes.

Step 5: Re-register Core Windows Installer Components

  • Open Command Prompt as Administrator.
  • Run: msiexec /unregister followed by msiexec /regserver.
  • Restart Windows 11 and attempt the installation again.

Alternative or Verification Steps

  • To verify the fix, re-run the installer and check the Event Viewer (Windows Logs > Application) for the absence of Event ID 1924 after installation completes.
  • If the issue persists, use the built-in System File Checker (sfc /scannow) and DISM (DISM /Online /Cleanup-Image /RestoreHealth) to repair underlying system file corruption that may be affecting the Installer service.

How to fix Error 1925 on Windows 11

Troubleshooting Guide: Error 1925 – “The Specified Profile Entry Could Not Be Added”

Why This Error Happens

Error 1925 typically occurs during software installation when the Windows Installer service lacks the necessary administrative permissions to write configuration data to the registry or user profile. This is often caused by restrictive User Account Control (UAC) settings, a corrupted user profile, or insufficient permissions on the target installation directory. In some cases, third-party security software may also block the installer from modifying critical system profile entries.

Step-by-Step Resolution Guide

Step 1: Run the Installer with Full Administrative Privileges

  • Right-click the installer executable (.exe or .msi) and select “Run as administrator.”
  • If the issue persists, temporarily disable UAC via Control Panel > User Accounts > Change User Account Control settings and slide it to “Never Notify.”
  • Restart the system before attempting the installation again.

Step 2: Verify and Reset Folder Permissions

  • Navigate to the target installation directory (commonly C:\Program Files\ or C:\Program Files (x86)\).
  • Right-click the folder, select “Properties,” then go to the “Security” tab.
  • Ensure the “Administrators” group and your current user account have “Full Control” permissions.
  • Apply changes and restart the installation process.

Step 3: Check and Repair the Local User Profile

  • Open Settings > Accounts > Other Users and check if the profile is loading correctly.
  • Alternatively, press Win + R, type regedit, and navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  • Look for any duplicate or corrupted profile keys (identified by a .bak suffix) and rename them back if a corruption is found.
  • Reboot the machine to allow Windows to rebuild the profile registry entries.

Step 4: Temporarily Disable Third-Party Antivirus Software

  • Open your antivirus dashboard (e.g., McAfee, Norton, Avast) and disable “Real-Time Protection” temporarily.
  • Attempt to re-run the installer while the protection is disabled.
  • Remember to re-enable the antivirus software immediately after the installation completes successfully.

Alternative or Verification Steps

  • To verify the fix, open Event Viewer (Win + X > Event Viewer), navigate to Windows Logs > Application, and confirm that no new Error 1925 or related MsiInstaller warnings appear after a fresh installation attempt.
  • If the error persists, use the Microsoft Program Install and Uninstall Troubleshooter to clean any residual, broken installer metadata before retrying the setup.

How to fix Error 1920 on Windows 11

Why This Error Happens

Error 1920 typically occurs during a Windows Installer (MSI) operation when the installer attempts to start or configure a service but cannot read, write, or execute a required file. This is usually caused by insufficient NTFS permissions on the target file or folder, a third-party antivirus/EDR tool locking the file mid-installation, or corruption in the Windows Installer cache located in C:\Windows\Installer. In some cases, a previous failed installation leaves a service in a “pending” state, which blocks the file handle needed for the new operation.

Step-by-Step Resolution Guide

Step 1: Verify and Reset File/Folder Permissions

  • Navigate to the file path mentioned in the error log (often under C:\Program Files\ or C:\Windows\System32\).
  • Right-click the file or parent folder, select Properties > Security > Advanced.
  • Ensure the SYSTEM and Administrators groups have Full Control.
  • Click Change Permissions, check Replace all child object permissions, and apply.

Step 2: Run the Installer with Elevated Privileges and Clean Boot

  • Right-click the installer .exe or .msi file and select Run as administrator.
  • If the error persists, boot into a Clean Boot state via msconfig.exe to rule out third-party service conflicts.
  • Temporarily disable third-party antivirus software, as many AV tools lock files during install/uninstall routines to scan them.

Step 3: Clear the Windows Installer Cache and Restart Services

  • Open Services.msc and ensure the Windows Installer service is set to Manual and is not stuck in a “Stopping” state; restart it if needed.
  • Open Command Prompt as Administrator and run:
  net stop msiserver
  net start msiserver
  • If the file lock persists, use Process Explorer (Sysinternals) to search for the locked file handle and terminate the locking process before retrying the installation.

Step 4: Repair or Reset the Windows Installer Package

  • Open Command Prompt as Administrator and run a system file check to rule out corruption:
  sfc /scannow
  • If the specific MSI package is corrupted, use the Microsoft Program Install and Uninstall Troubleshooter to remove the broken cache entry and re-run the installer.

Alternative or Verification Steps

  • To verify the fix, re-run the installer and check the Event Viewer (Windows Logs > Application) for a successful MsiInstaller event ID entry with no accompanying Error 1920.
  • If the issue persists after permission and service resets, perform a clean uninstall using the Microsoft Support and Recovery Assistant (SaRA) tool to fully purge residual files before reinstalling.

How to fix Error 1921 on Windows 11

Troubleshooting Guide: Windows Installer Error 1921

Why This Error Happens

Error 1921 occurs when the Windows Installer service attempts to stop, start, or interact with a service or file path that the system cannot properly resolve, often due to a corrupted file path reference or insufficient permissions. This is frequently triggered by a service that is stuck in a “stopping” or “starting” state, or by a broken environment variable that prevents the installer from locating the correct file name. Corrupted user profile permissions on the Windows Installer cache folder can also prevent the system from reading the file metadata required to complete the installation or uninstallation.

Step-by-Step Resolution Guide

Step 1: Verify and Restart the Windows Installer Service

  • Press Win + R, type services.msc, and press Enter.
  • Locate Windows Installer in the list, right-click it, and select Restart.
  • If the service is stuck on “Stopping,” reboot the PC in Safe Mode to force the service to reset before attempting the installation again.

Step 2: Check and Repair File Permissions

  • Navigate to C:\Windows\Installer in File Explorer.
  • Right-click the folder, select Properties > Security > Advanced.
  • Ensure the SYSTEM account and your Administrator user group have Full Control permissions.
  • Apply the changes and allow the system to propagate permissions to all sub-files.

Step 3: Clear Environment Variable Conflicts

  • Search for “Environment Variables” in the Windows 11 search bar and select Edit the system environment variables.
  • Under System variables, locate the TEMP and TMP variables.
  • Ensure these paths point to a valid, existing directory (e.g., C:\Windows\Temp) rather than a broken or deleted network path.

Step 4: Run the Windows Installer Troubleshooter

  • Download and run the official Microsoft Program Install and Uninstall Troubleshooter.
  • Select the specific application that is throwing the Error 1921 and allow the tool to automatically detect and fix corrupted registry keys associated with the file path.

Alternative or Verification Steps

  • To verify the fix, attempt to reinstall or uninstall the specific application that originally triggered the error; the installer should now proceed past the service verification stage without freezing.
  • If the error persists, boot into Clean Boot mode (via msconfig) to rule out a third-party service conflict that might be locking the specific file name mentioned in the error.

How to fix Error 1922 on Windows 11

Troubleshooting Guide: Error 1922 – “The Entry Is Not of the Expected Type”

Why This Error Happens

Error 1922 typically occurs when Windows encounters a registry entry, service configuration, or Active Directory object whose data type does not match what the system expects (for example, a REGSZ value where a REGDWORD is required). This often happens after a failed software installation, an interrupted Windows Update, or manual registry edits that leave orphaned or malformed keys. It can also surface when a service’s configuration in the registry becomes corrupted due to disk errors or improper shutdowns.

Step-by-Step Resolution Guide

Step 1: Identify the Faulty Registry Key or Service

  • Open Event Viewer (eventvwr.msc) and navigate to Windows Logs > Application to locate the exact source and timestamp of Error 1922.
  • Note the associated service name or registry path mentioned in the event description.
  • Cross-reference the service name in services.msc to confirm which component is affected.

Step 2: Inspect and Repair the Registry Entry

  • Open the Registry Editor (regedit) and navigate to the path identified in Step 1, commonly under:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
  • Check the value type of the problematic entry (right-click > Modify) and confirm it matches the expected type (e.g., DWORD vs. String).
  • If the entry is corrupted, export the key first as a backup (File > Export), then delete the malformed value and recreate it with the correct type and data, using a healthy system or Microsoft documentation as reference.

Step 3: Run System File and Component Store Repair

  • Open Command Prompt as Administrator and run:
    sfc /scannow
  • Follow this with a DISM repair to fix the underlying component store:
    DISM /Online /Cleanup-Image /RestoreHealth
  • Restart the machine once both commands complete successfully.

Step 4: Reinstall or Reset the Affected Service/Application

  • If the error is tied to a specific application, uninstall it completely via Settings > Apps > Installed Apps, then delete any leftover folders in C:\Program Files or C:\ProgramData.
  • Reinstall the application using the latest installer package from the vendor to regenerate clean registry entries.

Alternative or Verification Steps

  • After applying fixes, re-check Event Viewer for recurrence of Event ID 1922 during the next system boot or service start.
  • If the issue persists, use System Restore (rstrui.exe) to roll back to a restore point created before the error first appeared.

How to fix Error 1917 on Windows 11

Why This Error Happens

Error 1917 typically occurs during the installation or repair of printer drivers or other components that use Remote Procedure Call (RPC) pipes for communication between processes. This happens when the RPC service terminates the connection prematurely, often due to corrupted driver files, insufficient permissions on the Spooler service, or interference from third-party security software blocking the named pipes. In Windows 11, this is frequently tied to the Print Spooler service failing to complete its handshake with the installer package.

Step-by-Step Resolution Guide

Step 1: Restart the Print Spooler Service

  • Open the Run dialog (Win + R) and type services.msc, then press Enter.
  • Locate Print Spooler in the list, right-click it, and select Restart.
  • If the service fails to restart, right-click and select Stop, wait 10 seconds, then select Start again.

Step 2: Clear the Spooler Cache Directory

  • Navigate to C:\Windows\System32\spool\PRINTERS.
  • Delete all files within this folder (ensure the Spooler service is stopped first to avoid file lock errors).
  • Restart the Print Spooler service via services.msc to regenerate the cache.

Step 3: Run the Installer with Elevated Permissions

  • Right-click the installation .exe or .msi file and select Run as administrator.
  • If using Group Policy for driver deployment, verify the “Point and Print Restrictions” policy under Computer Configuration > Administrative Templates > Printers is not blocking the RPC pipe communication.
  • Temporarily disable third-party antivirus/firewall software to rule out pipe-blocking interference.

Step 4: Repair Corrupted System Files

  • Open Command Prompt as Administrator.
  • Run sfc /scannow to check for corrupted system files that may be interrupting the RPC handshake.
  • Follow up with DISM /Online /Cleanup-Image /RestoreHealth to repair the underlying Windows image if SFC reports unfixable errors.

Alternative or Verification Steps

  • After completing the steps above, reattempt the installation and check the Event Viewer (eventvwr.msc) under Windows Logs > Application to confirm Error 1917 no longer appears.
  • If the issue persists, try installing the driver/software using the Print Management Console (printmanagement.msc) instead of the standard installer, as this bypasses certain RPC pipe dependencies.

How to fix Error 1918 on Windows 11

Troubleshooting Guide: Error 1918 – “No More Data Is Available From the RPC Pipe”

Why This Error Happens

Error 1918 typically occurs during application installation when the Windows Installer service attempts to configure an ODBC data source but fails to communicate properly with the driver manager over the Remote Procedure Call (RPC) pipe. This is often caused by corrupted or outdated ODBC driver files, insufficient user permissions on the system’s driver registry keys, or a conflict between 32-bit and 64-bit driver components. In some cases, a stalled or misconfigured RPC service on Windows 11 prevents the installer from reading the full data stream required to complete the setup.

Step-by-Step Resolution Guide

Step 1: Verify and Restart the RPC Service

  • Press Win + R, type services.msc, and press Enter.
  • Locate Remote Procedure Call (RPC) in the list and confirm the status is “Running” and Startup Type is “Automatic.”
  • Right-click the service, select Restart, then also restart RPC Endpoint Mapper if present.
  • Reboot Windows 11 and retry the installation.

Step 2: Reinstall or Repair the ODBC Driver

  • Open Control Panel > System and Security > Windows Tools > ODBC Data Sources (64-bit).
  • Under the Drivers tab, identify the driver referenced in the installer logs (e.g., SQL Server, MySQL, etc.).
  • Uninstall the driver via Settings > Apps > Installed Apps, then download the latest version directly from the vendor’s official site.
  • Reinstall the driver, ensuring you select the correct architecture (32-bit vs. 64-bit) matching your application.

Step 3: Run the Installer with Elevated Privileges and Logging

  • Right-click the installer .exe or .msi file and select Run as administrator.
  • If the error persists, generate a verbose log by running:
  msiexec /i "C:\Path\To\Installer.msi" /L*V "C:\Logs\install_log.txt"
  • Open install_log.txt and search for “1918” to identify the exact driver name causing the failure.

Step 4: Check User Permissions on Registry and DLL Files

  • Navigate to C:\Windows\System32 and locate the relevant driver .dll file (e.g., SQLSRV32.dll).
  • Right-click the file, go to Properties > Security, and ensure your user account has Full Control.
  • Repeat this check for the registry path: HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI.

Alternative or Verification Steps

  • To verify the fix, reopen ODBC Data Sources (64-bit), click Add under the User DSN tab, and confirm the previously failing driver now appears and configures without errors.
  • If the issue persists, try running the Microsoft System File Checker (sfc /scannow) in an elevated Command Prompt to repair any underlying corrupted system files that may be blocking the RPC pipe communication.

How to fix Error 1919 on Windows 11

Why This Error Happens

Error 1919 combined with “No site name is available for this machine” typically occurs when a client machine cannot resolve its assignment to a management site—most commonly seen in System Center Configuration Manager (SCCM/ConfigMgr) environments or IIS virtual directory creation processes. The root cause is usually a missing or corrupted boundary group configuration, a failure in Active Directory Schema extension lookup, or the client’s inability to query the Management Point (MP) due to WMI repository corruption. In some IIS-specific cases, this error surfaces when the World Wide Web Publishing Service lacks the correct permissions to write to the metabase during virtual directory creation.

Step-by-Step Resolution Guide

Step 1: Verify Boundary Group and Site Assignment

  • Open the SCCM Console and navigate to Administration > Overview > Hierarchy Configuration > Boundary Groups.
  • Confirm the client’s subnet or Active Directory site is correctly mapped to a Boundary Group.
  • Check that the Boundary Group has an associated Management Point assigned under References.

Step 2: Repair the WMI Repository on the Client

  • Open Command Prompt as Administrator on the Windows 11 machine.
  • Run winmgmt /verifyrepository to check for corruption.
  • If corrupted, run winmgmt /salvagerepository followed by a system restart.

Step 3: Re-run the Client Push or Reinstall the Client Agent

  • Navigate to C:\Windows\ccmsetup\ccmsetup.log and review recent entries for site code errors.
  • Manually trigger installation using: ccmsetup.exe /mp:<MP_ServerName> SMSSITECODE=<YourSiteCode>
  • Ensure the correct site code is passed explicitly rather than relying on auto-discovery.

Step 4: Check IIS Permissions (If Applicable)

  • Open IIS Manager and navigate to the affected site under C:\inetpub\wwwroot.
  • Right-click the folder, go to Properties > Security, and confirm IIS_IUSRS has Read & Execute permissions.
  • Restart the World Wide Web Publishing Service via services.msc.

Alternative or Verification Steps

  • Open C:\Windows\ccmsetup\ccmsetup.log or ClientIDManagerStartup.log and confirm the line reading “Successfully created a new SMS BIOS UUID/GUID” followed by a valid site code assignment.
  • If the issue persists, delete the client’s record from SCCM (Devices > Delete), restart the Boundary Groups service, and re-push the client installation using the SMS Provider.

How to fix Error 1914 on Windows 11

Why This Error Happens

Error 1914 (RPCSINVALIDASYNCHANDLE) occurs when an application attempts to reference an asynchronous RPC handle that has already been completed, released, or was never properly initialized in memory. This typically stems from a corrupted RPC runtime library (rpcrt4.dll), a misconfigured DCOM security setting, or a service terminating mid-call before the handle could be properly closed. In most Windows 11 environments, this surfaces when the underlying Remote Procedure Call (RPC) service or DCOM Server Process Launcher is unstable or being blocked by security software.

Step-by-Step Resolution Guide

Step 1: Verify and Restart Core RPC Services

  • Press Win + R, type services.msc, and hit Enter.
  • Locate Remote Procedure Call (RPC) — ensure the Status is “Running” and Startup Type is “Automatic.” (Note: This service usually cannot be manually stopped, but confirm dependencies are active).
  • Locate DCOM Server Process Launcher and RPC Endpoint Mapper — right-click each and select Restart.
  • If the option is greyed out, restart the machine to force a refresh of these dependencies.

Step 2: Reset DCOM Permissions via Component Services

  • Open the Run dialog and type dcomcnfg, then press Enter.
  • Navigate to Component Services > Computers > My Computer.
  • Right-click My Computer, select Properties, and go to the COM Security tab.
  • Under “Access Permissions” and “Launch and Activation Permissions,” click Edit Default and ensure SYSTEM, NETWORK SERVICE, and Administrators have Local and Remote access checked.

Step 3: Run System File and DISM Scans

  • Open Windows Terminal (Admin) by right-clicking the Start menu.
  • Run the System File Checker to fix corrupted RPC libraries:
sfc /scannow
  • If corruption is found and not fully repaired, run the Deployment Image Servicing and Management tool to restore Windows system health:
DISM /Online /Cleanup-Image /RestoreHealth
  • Restart the PC once both scans complete.

Step 4: Check Firewall and Antivirus Interference

  • Go to Windows Security > Firewall & network protection.
  • Ensure that RPC dynamic port ranges (typically 49152–65535) are not being blocked by a third-party firewall or overly strict Group Policy.
  • Temporarily disable third-party antivirus software to test if it is intercepting the async RPC handle before re-enabling it with an exception for the affected application.

Alternative or Verification Steps

  • Verify the Fix: Open Event Viewer (eventvwr.msc) and check the Windows Logs > System folder. If the fix was successful, Error 1914 should no longer appear when you replicate the action that originally triggered the crash (e.g., launching the specific app or service).
  • Alternative Solution: If the error persists after the steps above, perform a Clean Boot (via msconfig) to identify if a third-party background service is hijacking the RPC handle before it can complete its cycle.

How to fix Error 1915 on Windows 11

Troubleshooting Guide: RPC Error 1915 – Invalid Asynchronous RPC Call Handle

Why This Error Happens

Error 1915 occurs when an application attempts to use an RPC (Remote Procedure Call) handle that has already been closed, released, or was never properly initialized during an asynchronous operation. This typically stems from corrupted RPC runtime files, a mismatch between the RPC client and server call sequence, or third-party software interfering with the RPC subsystem. In some cases, outdated network drivers or incomplete Windows updates can also leave the RPC handle table in an inconsistent state.

Step-by-Step Resolution Guide

Step 1: Restart Core RPC Services

  • Open Services (services.msc) via the Run dialog.
  • Locate Remote Procedure Call (RPC) and RPC Endpoint Mapper, right-click, and select Restart.
  • Ensure both services are set to Automatic startup type to prevent recurrence.

Step 2: Run System File and DISM Scans

  • Open Command Prompt (Admin) or Windows Terminal (Admin).
  • Execute: sfc /scannow to repair corrupted system files, including RPC-related DLLs.
  • Follow up with: DISM /Online /Cleanup-Image /RestoreHealth to fix the underlying Windows image if SFC reports unresolved errors.

Step 3: Update Network and Chipset Drivers

  • Navigate to Device Manager > Network adapters.
  • Right-click your active adapter and select Update driver > Search automatically for drivers.
  • Alternatively, download the latest driver package directly from the manufacturer’s website (Intel, Realtek, etc.) for guaranteed compatibility with Windows 11.

Step 4: Check for Conflicting Third-Party Software

  • Open Task Manager > Startup apps tab.
  • Disable any VPN, antivirus, or backup software known to hook into network/RPC calls (e.g., older firewall suites).
  • Reboot the system and attempt the failing operation again to isolate the conflict.

Step 5: Apply Pending Windows Updates

  • Go to Settings > Windows Update.
  • Install any pending Cumulative Updates or Optional Driver Updates, as Microsoft frequently patches RPC runtime bugs.
  • Restart the PC after installation to fully apply the changes.

Alternative or Verification Steps

  • To verify the fix, re-run the specific action that triggered Error 1915 (e.g., a network scan, print job, or COM+ application call) and monitor the Event Viewer (eventvwr.msc) under Windows Logs > System for recurrence.
  • If the error persists, use winmgmt /verifyrepository and winmgmt /salvagerepository in an elevated Command Prompt, as a corrupted WMI repository can sometimes mimic RPC handle errors.

How to fix Error 1916 on Windows 11

Why This Error Happens

Error 1916 occurs when the Remote Procedure Call (RPC) mechanism attempts to communicate over a named pipe that has already been terminated by either the client or server process. This typically happens due to a premature termination of the RPC service, network interruptions during installation or update processes, or corrupted RPC endpoint mapper configurations. Windows Installer and other system services relying on RPC communication are particularly susceptible when the RPC service (RpcSs) crashes or restarts unexpectedly mid-transaction.

Step-by-Step Resolution Guide

Step 1: Restart Core RPC Services

  • Open Services.msc by pressing Win + R, typing services.msc, and hitting Enter.
  • Locate Remote Procedure Call (RPC) and ensure the Status is “Running” and Startup Type is set to “Automatic.”
  • Right-click DCOM Server Process Launcher and select Restart (note: this may require a full reboot as RPC cannot always be manually stopped).
  • Run net stop rpcss followed by net start rpcss in an Administrator Command Prompt if manual restart is needed.

Step 2: Repair Corrupted System Files

  • Open Command Prompt as Administrator.
  • Run the System File Checker: sfc /scannow.
  • If corruption is found and not fully repaired, run the DISM tool: DISM /Online /Cleanup-Image /RestoreHealth.
  • Restart your computer once both scans complete successfully.

Step 3: Check Firewall and Port Configuration

  • Navigate to Control Panel > System and Security > Windows Defender Firewall > Advanced Settings.
  • Ensure that RPC (TCP port 135) and dynamic RPC ports are not blocked by inbound/outbound rules.
  • If using third-party antivirus software, temporarily disable it to rule out interference with the RPC endpoint mapper.

Step 4: Reset the Windows Installer Cache

  • Since this error frequently occurs during software installation/uninstallation, open Command Prompt as Administrator.
  • Run msiexec /unregister followed by msiexec /regserver to reset the Windows Installer service registration.
  • Attempt the installation or update process again to see if the pipe error persists.

Alternative or Verification Steps

  • To verify the fix, open Event Viewer (eventvwr.msc) and check Windows Logs > Application for any recurrence of Event ID 1916 after performing the steps above.
  • If the error persists specifically during software installation, try running the installer in a Clean Boot state (via msconfig) to rule out third-party service conflicts with the RPC subsystem.

How to fix Error 1911 on Windows 11

Why This Error Happens

Error 1911 typically occurs during application installation or uninstallation when the Windows Installer service cannot locate a registered COM component, DLL, or registry entry it expects to interact with. This is commonly caused by a corrupted or incomplete installer package, orphaned registry keys from a previous installation, or missing/misregistered system files required by the Windows Installer service. Insufficient permissions on the installation directory or registry hive can also trigger this failure.

Step-by-Step Resolution Guide

Step 1: Restart the Windows Installer Service

  • Press Win + R, type services.msc, and hit Enter.
  • Locate Windows Installer in the list, right-click it, and select Restart.
  • If the service is disabled, right-click, go to Properties, and set Startup type to Manual or Automatic.

Step 2: Re-register the Windows Installer Engine

  • Open Command Prompt as Administrator (Win + X > Terminal (Admin)).
  • Run the following commands one at a time:
  • msiexec /unregister
  • msiexec /regserver
  • Restart your PC after running these commands to apply changes.

Step 3: Run the Program Install and Uninstall Troubleshooter

  • Download and run Microsoft’s official Program Install and Uninstall Troubleshooter tool.
  • Select the problematic application from the list and choose Uninstall to clean up leftover registry entries.
  • Once completed, restart your system and attempt to reinstall the application.

Step 4: Clean Corrupted Registry Entries Manually

  • Press Win + R, type regedit, and press Enter.
  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
  • Locate the entry related to the failing application and delete the corresponding key (back up the registry first using File > Export).

Step 5: Perform a Clean Boot and Reinstall

  • Open msconfig via the Run dialog and switch to Selective Startup, disabling all non-Microsoft services under the Services tab.
  • Restart your PC and attempt the installation/uninstallation again in this clean environment.
  • Re-enable your startup services once the issue is resolved.

Alternative or Verification Steps

  • To verify the fix, check the Event Viewer (eventvwr.msc) under Windows Logs > Application to confirm no new Error 1911 entries appear during a fresh install attempt.
  • If the issue persists, use the System File Checker (sfc /scannow) and DISM (DISM /Online /Cleanup-Image /RestoreHealth) commands via an elevated Command Prompt to repair underlying system file corruption.

How to fix Error 1912 on Windows 11

Troubleshooting Guide: Error 1912 – “The Object Resolver Set Specified Was Not Found”

Why This Error Happens

Error 1912 typically occurs when the Windows Component Object Model (COM) registration database becomes corrupted or when a specific object resolver GUID referenced by an application is missing from the registry. This often happens after an incomplete software uninstall, a failed Windows Update, or corruption within the COM+ Catalog. In some cases, third-party security software may also strip or block registry entries required by the resolver set, triggering this error during application initialization.

Step-by-Step Resolution Guide

Step 1: Verify and Repair the COM+ Catalog

  • Open Command Prompt as Administrator (right-click Start > Terminal (Admin)).
  • Run sfc /scannow to scan for and repair corrupted system files, including COM registration data.
  • Restart the machine once the scan completes to apply repairs.

Step 2: Re-register the Affected DLL Files

  • Identify the specific application throwing Error 1912 (check Event Viewer under Windows Logs > Application).
  • Locate the associated DLL (commonly found in C:\Windows\System32 or the app’s install directory).
  • Run regsvr32 /u "filename.dll" followed by regsvr32 "filename.dll" to unregister and re-register the component.

Step 3: Rebuild the COM+ Applications via Component Services

  • Press Win + R, type dcomcnfg, and press Enter to open Component Services.
  • Navigate to Component Services > Computers > My Computer > COM+ Applications.
  • Right-click on the affected application (if visible) and select Delete, then reinstall the parent software to force a clean re-creation of the resolver set.

Step 4: Run the Windows Update Troubleshooter

  • Go to Settings > System > Troubleshoot > Other Troubleshooters.
  • Run the Windows Update troubleshooter to catch any stalled updates that may have left COM registrations incomplete.
  • Reboot and check if the error persists when relaunching the application.

Step 5: Perform a Clean Boot to Isolate Conflicts

  • Type msconfig in the Run dialog and press Enter.
  • Under the Services tab, check Hide all Microsoft services, then click Disable all.
  • Restart the PC and test the application again to rule out third-party interference with the resolver.

Alternative or Verification Steps

  • To verify the fix, relaunch the application that previously threw Error 1912 and check the Event Viewer (Windows Logs > Application) to confirm no new 1912 events are logged.
  • If the error persists after all steps, use the System Restore feature (rstrui.exe) to roll the OS back to a restore point created before the error first appeared.

How to fix Error 1913 on Windows 11

Why This Error Happens

Error 1913 with the “data remains to be sent in the request buffer” message typically occurs when a network connection is terminated or interrupted before the TCP/IP stack has finished flushing an outbound packet. This is commonly caused by a misconfigured MTU (Maximum Transmission Unit) size, an overly aggressive firewall or antivirus tool inspecting/dropping packets mid-transmission, or a corrupted Winsock catalog on Windows 11. In some cases, outdated or unstable network adapter drivers fail to acknowledge the full data payload, leaving residual data stuck in the buffer.

Step-by-Step Resolution Guide

Step 1: Reset the Winsock Catalog and TCP/IP Stack

  • Open Command Prompt as Administrator (search “cmd,” right-click, “Run as administrator”).
  • Run: netsh winsock reset
  • Run: netsh int ip reset
  • Restart your PC to apply the reset.

Step 2: Adjust MTU and Disable TCP Auto-Tuning

  • In the same elevated Command Prompt, run: netsh interface ipv4 show subinterfaces to check current MTU values.
  • Set MTU manually if it’s inconsistent (commonly 1500 for Ethernet, 1492 for PPPoE): netsh interface ipv4 set subinterface "Ethernet" mtu=1472 store=persistent
  • Disable TCP auto-tuning temporarily to rule out buffer scaling issues: netsh interface tcp set global autotuninglevel=disabled

Step 3: Check Firewall and Antivirus Interference

  • Navigate to Windows Security > Firewall & network protection > Allow an app through firewall.
  • Temporarily disable third-party antivirus/firewall software (e.g., Norton, McAfee) and retest the failing operation.
  • If the issue disappears, add an exception for the affected application/port in your antivirus’s network inspection settings.

Step 4: Update or Roll Back Network Adapter Drivers

  • Open Device Manager (Win + X > Device Manager).
  • Expand Network Adapters, right-click your active adapter, and select Update driver.
  • If the error started after a recent update, choose Properties > Driver tab > Roll Back Driver instead.

Step 5: Restart Core Networking Services

  • Press Win + R, type services.msc, and press Enter.
  • Locate Windows Installer, Base Filtering Engine, and Network Connections — right-click each and select Restart.
  • Retry the operation that triggered Error 1913.

Alternative or Verification Steps

  • After applying the fixes, run the original task again (installation, upload, or network request) and confirm no buffer-related error appears in Event Viewer under Windows Logs > Application.
  • If the error persists, test the operation on a different network (e.g., mobile hotspot) to isolate whether the issue is caused by local network hardware (router/switch) rather than the Windows 11 machine itself.

How to fix Error 1908 on Windows 11

Troubleshooting Guide: Error 1908 – Could Not Find the Domain Controller

Why This Error Happens

Error 1908 typically occurs when a Windows 11 client cannot properly resolve or communicate with a domain controller due to DNS misconfiguration, as the client relies on DNS SRV records to locate domain services. This can also result from network connectivity issues, incorrect network adapter DNS settings pointing to a public DNS server instead of the internal DNS server, or a mismatch in domain trust relationships caused by an outdated computer account password. Additionally, firewall rules blocking essential Active Directory ports (such as 389, 445, or 88) can prevent the handshake needed to locate the domain controller.

Step-by-Step Resolution Guide

Step 1: Verify and Correct DNS Settings

  • Open Control Panel and navigate to Network and Sharing Center, then click on your active network adapter.
  • Right-click the adapter, select Properties, then double-click Internet Protocol Version 4 (TCP/IPv4).
  • Ensure the “Preferred DNS server” field points to your internal Domain Controller’s IP address (e.g., 192.168.1.10), not a public DNS like 8.8.8.8.
  • Run ipconfig /flushdns in Command Prompt to clear any cached incorrect records.

Step 2: Check Network Connectivity to the Domain Controller

  • Open Command Prompt as Administrator and run ping [DomainControllerName] to check basic connectivity.
  • Run nltest /dsgetdc:[YourDomainName] to specifically query if the client can locate a domain controller.
  • If this fails, check physical network cables, VPN connections, or Wi-Fi stability to ensure the machine is on the correct subnet/VLAN.

Step 3: Rejoin the Device to the Domain

  • Navigate to Settings > System > About > Advanced system settings.
  • Click the Computer Name tab, select Change, and temporarily switch the PC to a Workgroup (e.g., “WORKGROUP”) to reset the machine account.
  • Restart the PC, then repeat the steps to switch back to the Domain, entering valid domain admin credentials to re-establish the trust relationship.

Step 4: Review Windows Firewall and Security Software

  • Ensure that ports 53 (DNS), 88 (Kerberos), 389 (LDAP), and 445 (SMB) are not blocked by third-party antivirus or the built-in Windows Defender Firewall.
  • Temporarily disable third-party security software to test if it is the root cause of the blocked authentication request.

Alternative or Verification Steps

  • Verify the Fix: Open Command Prompt and run gpupdate /force and nltest /sc_verify:[YourDomainName]. If these commands complete without error, the trust relationship and domain controller location are successfully restored.
  • Alternative Solution: If rejoining the domain fails, use the Active Directory Users and Computers (ADUC) console on a server to reset the specific computer account, then attempt the domain join process again on the Windows 11 client.

How to fix Error 1909 on Windows 11

Why This Error Happens

Error 1909 with the “referenced account is currently locked out” message occurs when Windows detects that a user account has exceeded the maximum number of failed login attempts defined by the local or domain security policy. This lockout mechanism is a security feature designed to prevent brute-force password attacks, but it can also trigger from cached credentials, expired passwords syncing incorrectly, or a stuck service using outdated login information. In domain environments, this can also stem from Group Policy replication delays or a Domain Controller enforcing an outdated lockout threshold.

Step-by-Step Resolution Guide

Step 1: Verify the Account Lockout Status

  • Open Local Users and Groups by pressing Win + R, typing lusrmgr.msc, and hitting Enter.
  • Navigate to Users, right-click the affected account, and select Properties.
  • Check the Account is locked out checkbox under the General tab — if checked, uncheck it and click Apply.

Step 2: Check and Adjust Account Lockout Policy

  • Open the Local Security Policy editor via Win + R and type secpol.msc.
  • Navigate to Account Policies > Account Lockout Policy.
  • Review the Account lockout threshold, Account lockout duration, and Reset account lockout counter after settings.
  • Increase these values temporarily (e.g., threshold to 10 attempts) if repeated false lockouts are occurring due to cached credentials.

Step 3: Clear Cached Credentials Causing Repeated Failed Logins

  • Open Control Panel > Credential Manager.
  • Under Windows Credentials, remove any outdated or duplicate entries related to the locked account.
  • Restart the system and attempt to log in again using the correct credentials.

Step 4: Check for Domain-Level Lockout (If Applicable)

  • On a domain-joined machine, run gpupdate /force in an elevated Command Prompt to sync the latest Group Policy settings.
  • If part of an Active Directory environment, ask your administrator to check the Domain Controller Security Policy for lockout enforcement using dsa.msc or the Active Directory Users and Computers console.

Step 5: Unlock the Account via Command Prompt (Local Fallback)

  • Open Command Prompt as Administrator.
  • Run the following command to manually reset the lockout flag:
  net user "username" /active:yes
  • Restart the machine and test the login again.

Alternative or Verification Steps

  • To verify the fix, attempt to log in with the affected account immediately after applying changes — if successful without the 1909 error, the lockout has been cleared.
  • If the issue persists, boot into Safe Mode (Shift + Restart from the login screen) and repeat Steps 1 and 3, as background services holding stale credentials may be preventing the unlock from taking effect in normal mode.

How to fix Error 1910 on Windows 11

Windows Error 1910: “The Object Exporter Specified Was Not Found” Troubleshooting Guide

Why This Error Happens

Error 1910 typically occurs when the Windows DCOM (Distributed Component Object Model) subsystem cannot locate a registered object exporter, often due to a corrupted or incomplete COM/DCOM registration in the registry. This can happen after a failed software uninstall, a botched Windows Update, or when a service tries to reference a GUID that no longer exists in the registry. Insufficient permissions on the DCOM configuration for the associated application can also trigger this error.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Application via Event Viewer

  • Open Event Viewer by pressing Win + R, typing eventvwr.msc, and pressing Enter.
  • Navigate to Windows Logs > System and filter for Event ID 1910.
  • Note the Application ID (AppID) or GUID listed in the event details, as this identifies the broken DCOM exporter.

Step 2: Verify and Repair DCOM Permissions

  • Press Win + R, type dcomcnfg, and press Enter to open Component Services.
  • Navigate to Component Services > Computers > My Computer > DCOM Config.
  • Locate the application matching the GUID from Step 1, right-click it, select Properties, and go to the Security tab.
  • Under “Launch and Activation Permissions,” click Edit and ensure SYSTEM, Administrators, and INTERACTIVE have Local Launch and Local Activation rights.

Step 3: Re-register the Missing COM Component

  • Open Command Prompt as Administrator (right-click Start > Terminal (Admin)).
  • Run the following command to re-register the DLL associated with the exporter (replace with the actual file path):
  regsvr32 /s "C:\Windows\System32\[missing_component].dll"
  • If the exact DLL is unknown, run a full system file scan instead:
  sfc /scannow

Step 4: Clean Up Orphaned Registry Entries

  • Press Win + R, type regedit, and press Enter to open the Registry Editor.
  • Navigate to HKEY_CLASSES_ROOT\AppID\{GUID} (using the GUID identified in Step 1).
  • If the key exists but points to a non-existent file path, back up the key (right-click > Export) and then delete it to force Windows to reset the exporter reference.

Step 5: Restart the DCOM Server Process Launcher Service

  • Press Win + R, type services.msc, and press Enter.
  • Locate DCOM Server Process Launcher, right-click it, and select Restart.
  • Restart your computer to ensure the DCOM registry changes take full effect.

Alternative or Verification Steps

  • Verify the Fix: Reopen Event Viewer and check if Event ID 1910 reappears in the System log after reproducing the action that originally triggered the error (e.g., opening the specific application).
  • Alternative Solution: If the error persists, run System Restore (via rstrui.exe) to a restore point predating the issue, as this often resolves deep DCOM registry corruption that manual editing cannot fix.

How to fix Error 1904 on Windows 11

Troubleshooting Guide: Error 1904 – “The Specified Printer Handle Is Already Being Waited On”

Why This Error Happens

This error occurs when the Windows Print Spooler service attempts to register a wait operation on a printer handle that is already flagged as pending in the system’s internal handle table. It is typically triggered by a corrupted spooler cache, a stuck print job that failed to release its handle, or a conflict caused by outdated/corrupted printer drivers. In some cases, this can also result from multiple applications simultaneously attempting to access the same printer object without properly closing previous handles.

Step-by-Step Resolution Guide

Step 1: Restart the Print Spooler Service

  • Press Win + R, type services.msc, and hit Enter.
  • Locate Print Spooler in the list, right-click it, and select Stop.
  • Navigate to C:\Windows\System32\spool\PRINTERS and delete all files in this folder to clear stuck jobs.
  • Go back to services.msc, right-click Print Spooler, and select Start.

Step 2: Reset the Printer Driver

  • Open Settings > Bluetooth & devices > Printers & scanners.
  • Select the affected printer and click Remove device.
  • Download the latest driver from the manufacturer’s official website (avoid using outdated Windows Update drivers if the issue persists).
  • Reinstall the printer using the fresh driver package.

Step 3: Run the Windows Printer Troubleshooter

  • Go to Settings > System > Troubleshoot > Other troubleshooters.
  • Locate Printer and click Run.
  • Allow Windows to automatically detect and fix handle conflicts or driver mismatches.

Step 4: Check for Conflicting Print Applications

  • Ensure no other background application (e.g., PDF creators, scanning software) is actively holding a handle to the same printer.
  • Use Task Manager > Processes to end any non-essential printing-related background tasks before retrying the print job.

Alternative or Verification Steps

  • After completing the steps, print a test page via Settings > Printers & scanners > [Your Printer] > Print test page to confirm the handle conflict is resolved.
  • If the error persists, use sfc /scannow in an elevated Command Prompt to repair corrupted system files that may be affecting the spooler service.

How to fix Error 1905 on Windows 11

Troubleshooting Guide: Error 1905 – “The Specified Printer Has Been Deleted” (Windows 11)

Why This Error Happens

Error 1905 typically occurs when the printer object referenced in the Windows registry or spooler cache no longer matches an active printer instance, often due to a corrupted print spooler queue or an incomplete driver uninstallation. This can also happen when a network printer connection is dropped or renamed on the print server while a local client still holds a stale reference to the old printer object. Additionally, insufficient permissions on the print spooler service or corrupted registry keys under the printer’s configuration path can trigger this false “deleted” status even when the printer is still physically connected.

Step-by-Step Resolution Guide

Step 1: Restart the Print Spooler Service

  • Open the Run dialog (Win + R) and type services.msc, then press Enter.
  • Locate Print Spooler in the list, right-click it, and select Restart.
  • Alternatively, run this command in an elevated PowerShell window: Restart-Service -Name Spooler -Force
  • This clears any stuck jobs or stale references causing the error.

Step 2: Remove the Printer via Registry and Settings

  • Navigate to Settings > Bluetooth & devices > Printers & scanners.
  • Select the problematic printer and click Remove device.
  • Open Registry Editor (regedit) and go to:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers
  • Delete the subfolder matching the deleted printer’s name to clear any leftover corrupted entries.

Step 3: Reinstall the Printer Driver

  • Go to Settings > Bluetooth & devices > Printers & scanners > Add device.
  • If the printer doesn’t appear automatically, click Add manually and select the correct port (e.g., WSD-XXXX or TCP/IP).
  • Download and install the latest driver directly from the manufacturer’s website instead of relying on Windows Update.
  • Restart the computer after installation to finalize the driver registration.

Step 4: Clear the Print Spooler Cache Folder

  • Stop the Print Spooler service first (see Step 1).
  • Navigate to C:\Windows\System32\spool\PRINTERS in File Explorer.
  • Delete all files inside this folder (these are cached print jobs, not system files).
  • Restart the Print Spooler service to regenerate a clean cache.

Alternative or Verification Steps

  • To verify the fix, print a test page via Settings > Printers & scanners > [Printer Name] > Print test page; if it completes without the 1905 error, the issue is resolved.
  • If the error persists, run the built-in Printer Troubleshooter (Settings > System > Troubleshoot > Other troubleshooters > Printer) to automatically detect and repair remaining configuration conflicts.

How to fix Error 1906 on Windows 11

Why This Error Happens

Error 1906 typically occurs during printer driver installation or configuration when the Windows Print Spooler service cannot properly register the printer’s state due to corrupted spooler data or conflicting driver files. This often happens after a failed driver update, a corrupted registry entry related to the printer port, or insufficient permissions on the spooler directory. In many cases, leftover files from a previous printer installation interfere with the new configuration, causing Windows to report the printer state as “invalid.”

Step-by-Step Resolution Guide

Step 1: Stop and Restart the Print Spooler Service

  • Press Win + R, type services.msc, and press Enter.
  • Locate Print Spooler in the list, right-click it, and select Stop.
  • Navigate to C:\Windows\System32\spool\PRINTERS and delete all files inside this folder (these are stuck print jobs and cached data).
  • Go back to services.msc, right-click Print Spooler, and select Start.

Step 2: Remove the Corrupted Printer Entry

  • Open Settings > Bluetooth & devices > Printers & scanners.
  • Select the problematic printer and click Remove Device.
  • Open Device Manager, expand Print queues, right-click the printer entry (if still listed), and select Uninstall device.
  • Restart your computer to clear any residual driver locks.

Step 3: Reinstall the Printer Driver Manually

  • Download the latest driver package directly from the manufacturer’s official website (avoid using outdated Windows Update drivers).
  • Run the installer as Administrator by right-clicking the setup file and selecting Run as administrator.
  • During installation, choose Add a local printer or network printer with manual settings if prompted, and select the correct port (usually USB001 or the assigned TCP/IP port).

Step 4: Check Registry Permissions (If Issue Persists)

  • Press Win + R, type regedit, and press Enter.
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers.
  • Right-click the printer’s folder key, select Permissions, and ensure SYSTEM and Administrators have Full Control.
  • Close the Registry Editor and restart the Print Spooler service again.

Alternative or Verification Steps

  • To verify the fix, print a test page via Settings > Printers & scanners > [Your Printer] > Printer properties > Print Test Page. If it completes without an error prompt, the issue is resolved.
  • If the error persists, run the built-in Printer Troubleshooter via Settings > System > Troubleshoot > Other troubleshooters > Printer, which can automatically detect and repair spooler-related conflicts.

How to fix Error 1907 on Windows 11

Why This Error Happens

Error 1907 occurs when Windows enforces a password expiration policy, but the system is unable to properly process the password change at the login screen due to policy conflicts, a corrupted user profile, or synchronization issues with the local Security Accounts Manager (SAM) database. This is common when a Group Policy forces password expiration while the local cache still holds an outdated credential state, or when the account’s password has genuinely expired and requires an update through a legitimate administrative channel.

Step-by-Step Resolution Guide

Step 1: Verify Password Expiration Policy Settings

  • Open the Run dialog (Win + R) and type secpol.msc to launch the Local Security Policy editor.
  • Navigate to Account Policies > Password Policy and check the “Maximum password age” setting.
  • If this value is too aggressive (e.g., set to 0 or 1 day), adjust it to a reasonable value like 30 or 90 days.

Step 2: Reset the Password via Safe Mode or Admin Account

  • Restart the PC and boot into Safe Mode by holding Shift while clicking Restart, then navigating to Troubleshoot > Advanced Options > Startup Settings.
  • Log in using a separate local Administrator account if available.
  • Open Command Prompt as Administrator and run: net user [username] * to force a manual password reset without triggering the expired flag incorrectly.

Step 3: Clear Cached Credentials

  • Open Command Prompt as Administrator and run rundll32.exe keymgr.dll, KRShowKeyMgr to open the Stored User Names and Passwords utility.
  • Remove any outdated or conflicting cached credentials associated with the affected user account.
  • Restart the machine to allow Windows to rebuild the credential cache cleanly.

Step 4: Check for Account Lockout via Group Policy Sync

  • Run gpupdate /force in an elevated Command Prompt to ensure the machine has the latest domain or local policy configurations.
  • If the machine is domain-joined, verify connectivity to the Domain Controller using nltest /sc_verify:[domainname] to ensure trust relationships are intact.

Alternative or Verification Steps

  • After resetting the password, log out completely and attempt a fresh login to confirm the “must change password” prompt no longer appears.
  • If the error persists, use chkdsk /f on the system drive to rule out disk corruption affecting the SAM database file located in C:\Windows\System32\config.

How to fix Error 1901 on Windows 11

Windows 11 Error 1901: “The Specified Time Is Invalid” Troubleshooting Guide

Why This Error Happens

Error 1901 typically occurs when the Windows Installer service encounters a timestamp mismatch during the installation or update process, often due to an incorrect system clock, timezone misconfiguration, or corrupted regional settings. This can also stem from conflicts between the system’s locale settings and the installer package’s embedded time validation checks. In some cases, a corrupted Windows Installer cache or outdated system files exacerbate the issue, causing the installer to reject an otherwise valid timestamp.

Step-by-Step Resolution Guide

Step 1: Verify and Correct System Date, Time, and Timezone

  • Navigate to Settings > Time & Language > Date & Time.
  • Ensure “Set time automatically” and “Set time zone automatically” toggles are turned On.
  • If automatic sync fails, manually correct the date, time, and timezone to match your actual location.
  • Click Sync now under the “Additional settings” section to force an immediate time synchronization with Windows Time servers.

Step 2: Restart the Windows Time Service

  • Press Win + R, type services.msc, and hit Enter.
  • Locate Windows Time in the service list.
  • Right-click and select Restart. If the service is disabled, right-click, choose Properties, and set the Startup type to Automatic.
  • Alternatively, run these commands in an elevated Command Prompt:
  • net stop w32time
  • net start w32time
  • w32tm /resync

Step 3: Clear the Windows Installer Cache

  • Press Win + R, type %windir%\Installer, and hit Enter.
  • Back up the folder contents (do not delete outright) to a temporary location like C:\InstallerBackup.
  • Restart the Windows Installer service via services.msc (locate Windows Installer, right-click, and select Restart).
  • Attempt the installation again to see if the corrupted cache was the culprit.

Step 4: Run System File Checker and DISM Scans

  • Open Command Prompt as Administrator.
  • Run sfc /scannow to repair corrupted system files.
  • Follow up with DISM /Online /Cleanup-Image /RestoreHealth to fix any underlying Windows image corruption.
  • Restart your PC once both scans complete successfully.

Step 5: Update Regional and Language Settings

  • Go to Settings > Time & Language > Language & Region.
  • Confirm the “Country or region” and “Regional format” settings align with your actual location and locale.
  • Reboot the system after making changes to ensure the installer re-reads updated locale data.

Alternative or Verification Steps

  • After completing the steps above, re-run the installer or update that originally triggered Error 1901. If it completes without the “specified time is invalid” message, the fix was successful.
  • If the error persists, try running the installer in Compatibility Mode for an earlier Windows version (right-click the installer .exe > Properties > Compatibility tab) or perform the installation using a local administrator account to rule out permission-related timestamp validation conflicts.

How to fix Error 1902 on Windows 11

Troubleshooting Guide: Error 1902 – “The Specified Form Name Is Invalid”

Why This Error Happens

Error 1902 typically occurs when a Windows Installer package attempts to reference a dialog or form that does not exist within its internal database, often due to a corrupted or incomplete MSI installation file. This can also result from mismatched installer versions, where a patch or update references form elements that were removed or renamed in the base installer. Additionally, damaged Windows Installer cache files (stored in C:\Windows\Installer) can cause the installer engine to misread form definitions, triggering this error during setup or repair operations.

Step-by-Step Resolution Guide

Step 1: Verify and Repair the Windows Installer Service

  • Open the Start menu, type services.msc, and press Enter.
  • Locate Windows Installer in the list, right-click it, and select Restart.
  • Ensure the Startup type is set to Manual (not Disabled).
  • Run Command Prompt as Administrator and execute: msiexec /unregister followed by msiexec /regserver to re-register the installer engine.

Step 2: Clear the Corrupted Installer Cache

  • Navigate to C:\Windows\Installer using File Explorer (you may need to unhide protected system files via View > Show > Hidden items).
  • Identify the specific .msi or .msp file related to the failing application (cross-reference using the Registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData).
  • Do not delete the entire folder; instead, rename the suspected corrupted file (e.g., add .old extension) to force Windows to request a fresh copy.
  • Re-run the installation or update process to see if the system pulls a clean form definition.

Step 3: Run the Microsoft Program Install and Uninstall Troubleshooter

  • Download the official troubleshooter from the Microsoft Support site.
  • Run the tool and select the application throwing Error 1902 from the list.
  • Choose Uninstall if the app is already partially installed, or Fix problems installing programs if it fails to install.
  • Restart the computer once the troubleshooter completes its cleanup process.

Step 4: Perform a Clean Boot to Rule Out Conflicts

  • Type msconfig into the Windows search bar and open System Configuration.
  • Under the Services tab, check Hide all Microsoft services, then click Disable all.
  • Go to the Startup tab, open Task Manager, and disable all non-essential startup items.
  • Restart the PC and attempt the installation again in this clean environment to check for third-party software conflicts.

Alternative or Verification Steps

  • Verify the Fix: Open Event Viewer (eventvwr.msc), navigate to Windows Logs > Application, and confirm that Event ID 1902 no longer appears after attempting the installation again.
  • Alternative Solution: If the error persists, use the System File Checker by running sfc /scannow in an Administrator Command Prompt to repair any underlying corrupted system files that might be interfering with the Windows Installer service.

How to fix Error 1903 on Windows 11

Why This Error Happens

Error 1903 (“The specified form size is invalid”) typically occurs during application installation or configuration when the Windows Installer service encounters a corrupted dialog template or an incompatible display scaling setting. This often results from damaged installer cache files (.msi database corruption) or a mismatch between the application’s UI resources and the system’s current DPI/resolution configuration. It can also surface when registry entries related to installer form dimensions have been improperly modified or left over from a failed previous installation.

Step-by-Step Resolution Guide

Step 1: Reset Windows Installer Cache

  • Press Win + R, type services.msc, and press Enter.
  • Locate Windows Installer in the list, right-click it, and select Stop.
  • Navigate to C:\Windows\Installer and rename the folder temporarily to Installer_old (do not delete it outright, as some cached files are still referenced by installed apps).
  • Restart the Windows Installer service by right-clicking it again and selecting Start.

Step 2: Adjust Display Scaling and Compatibility Settings

  • Right-click the installer .exe or .msi file and select Properties.
  • Go to the Compatibility tab and check the box for Disable display scaling on high DPI settings.
  • Apply the changes, then click OK and attempt the installation again.
  • If the issue persists, set the Compatibility mode to an earlier Windows version (e.g., Windows 8) under the same tab.

Step 3: Repair or Re-register the Windows Installer Engine

  • Open Command Prompt as Administrator (Win + X → Terminal (Admin)).
  • Run the following command to re-register the installer engine:
    msiexec /unregister
  • Immediately follow with:
    msiexec /regserver
  • Reboot the system to ensure the changes take effect before retrying the installation.

Step 4: Run the Windows Installer Troubleshooter

  • Go to Settings > System > Troubleshoot > Other troubleshooters.
  • Locate Program Compatibility Troubleshooter and run it against the problematic installer file.
  • Follow the on-screen prompts to allow Windows to automatically detect and apply the correct form/resolution settings for the app.

Alternative or Verification Steps

  • To verify the fix, re-run the installer and confirm that the setup wizard window renders correctly without triggering Error 1903.
  • If the error persists, download a fresh copy of the installer from the vendor’s official source, as the original file may be corrupted, and attempt the installation on a local admin account rather than a domain or restricted profile.

How to fix Error 1898 on Windows 11

Why This Error Happens

Error 1898 (“The group member was not found”) typically occurs when Windows attempts to resolve a Security Identifier (SID) within a Security Group, but the SID no longer maps to a valid User or Computer object in the directory. This is common after Active Directory replication issues, orphaned SIDs left behind from deleted user accounts, or corruption within the Local Security Authority (LSA) database. It can also surface during Group Policy processing if a policy references a group member that has since been removed or is unreachable due to a broken trust relationship.

Step-by-Step Resolution Guide

Step 1: Verify Active Directory Connectivity and Replication

  • Open Command Prompt as Administrator and run repadmin /replsummary to check for replication failures between Domain Controllers.
  • Ensure DNS resolution is functioning correctly using nslookup <DomainController_FQDN>.
  • If replication errors are found, run repadmin /syncall /A /e /P to force a manual sync.

Step 2: Identify and Remove Orphaned SIDs

  • Navigate to Active Directory Users and Computers (dsa.msc).
  • Enable Advanced Features under the View menu to inspect group memberships directly.
  • Locate the specific group throwing the error and check the Members tab for any entries showing as raw SID strings (e.g., S-1-5-21-…) rather than resolved usernames.
  • Remove any unresolved SID entries, as these are “ghost” members causing the lookup failure.

Step 3: Reset Local Group Policy Cache

  • Press Win + R and type gpedit.msc to open the Local Group Policy Editor to confirm no local override is causing the conflict.
  • Navigate to C:\Windows\System32\GroupPolicy and rename the folder to GroupPolicy.old to force Windows to rebuild the cache.
  • Restart the machine and run gpupdate /force in an elevated Command Prompt to regenerate a clean policy cache.

Step 4: Run System File and DISM Repair

  • Open Command Prompt as Administrator.
  • Execute sfc /scannow to repair any corrupted system files that might be interfering with the LSA subsystem.
  • Follow up with DISM /Online /Cleanup-Image /RestoreHealth to repair the underlying Windows image if SFC reports unrepairable errors.

Alternative or Verification Steps

  • After completing the steps, open Event Viewer (eventvwr.msc) and check the System and Directory Service logs to confirm Error 1898 no longer appears following a reboot or Group Policy refresh.
  • If the error persists specifically during a Domain Controller demotion or promotion, use the ntdsutil metadata cleanup utility to manually purge the offending server object from Active Directory before retrying the operation.

How to fix Error 1899 on Windows 11

Why This Error Happens

Error 1899 typically occurs when the RPC (Remote Procedure Call) endpoint mapper service fails to register a new entry in its database, often due to the RPC Endpoint Mapper service or DCOM Server Process Launcher not running correctly. This can be caused by corrupted RPC service configurations, insufficient permissions on the registry keys governing RPC services, or conflicts from third-party security software intercepting RPC communications. In some cases, a corrupted system file related to rpcss.dll or improper service dependencies can also trigger this failure.

Step-by-Step Resolution Guide

Step 1: Verify RPC Service Status

  • Press Win + R, type services.msc, and press Enter.
  • Locate Remote Procedure Call (RPC) and ensure the Status is set to “Running” and Startup Type is “Automatic.”
  • Locate DCOM Server Process Launcher and RPC Endpoint Mapper, confirming both are also running with Automatic startup type.
  • Right-click any stopped service and select Start.

Step 2: Run System File Checker and DISM

  • Open Command Prompt as Administrator.
  • Run the command: sfc /scannow
  • Once complete, run: DISM /Online /Cleanup-Image /RestoreHealth
  • Restart your computer to apply repairs to corrupted system files that may affect RPC services.

Step 3: Check Registry Permissions

  • Press Win + R, type regedit, and press Enter.
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RpcSs.
  • Right-click the RpcSs key, select Permissions, and ensure “SYSTEM” and “Administrators” have Full Control.
  • Apply changes and restart the RPC-related services from Step 1.

Step 4: Disable Conflicting Third-Party Software

  • Temporarily disable third-party antivirus or firewall software (e.g., via the system tray icon or its settings panel).
  • Attempt to reproduce the error to see if it resolves with the security software disabled.
  • If confirmed as the cause, update the software to the latest version or configure an exception for RPC-related processes.

Alternative or Verification Steps

  • To verify the fix, open Event Viewer (eventvwr.msc), navigate to Windows Logs > System, and confirm Error 1899 no longer appears after performing the actions that previously triggered it.
  • If the issue persists, consider performing an in-place upgrade repair using Windows 11 installation media, which resets system files and services without deleting personal data.