Why This Error Happens
Error 11606 occurs when a Transact-SQL statement references a four-part object name (Server.Database.Schema.Object) where the server portion does not match the local server’s registered name, and the statement type does not support remote/linked server execution (such as certain DDL statements, INSERT/UPDATE/DELETE targets in specific contexts, or system stored procedures). SQL Server 2025 enforces stricter validation on fully qualified names to prevent ambiguous cross-server operations in non-distributed queries. This typically happens after a server rename, a restored database from a different host, or a misconfigured linked server alias that doesn’t match @@SERVERNAME.
Step-by-Step Resolution Guide
Step 1: Verify the Local Server Name Matches @@SERVERNAME
- Open SQL Server Management Studio (SSMS) and run
SELECT @@SERVERNAME;. - Compare this output to the actual machine name via
SELECT SERVERPROPERTY('MachineName');andSELECT SERVERPROPERTY('ServerName');. - If these values differ (common after cloning a VM or renaming a Windows Server 2025 host), this mismatch is the likely root cause.
Step 2: Correct the Server Name Using sp_dropserver and sp_addserver
- Run the following in a query window connected via SSMS:
EXEC sp_dropserver 'OldServerName';EXEC sp_addserver 'NewServerName', local;- Restart the SQL Server service via
services.mscorRestart-Service MSSQLSERVERin PowerShell (run as Administrator). - Re-run
SELECT @@SERVERNAME;to confirm the update took effect.
Step 3: Review and Correct the Offending Query
- Identify the exact statement referencing the four-part name from the error output.
- Remove the explicit server name prefix if the object is local (e.g., change
ServerName.DBName.dbo.TableNametoDBName.dbo.TableName). - If cross-server access is intended, ensure a proper linked server is configured via
sp_addlinkedserverand that the query usesOPENQUERY()instead of direct four-part naming for unsupported statement types.
Step 4: Validate Linked Server Configuration (If Applicable)
- In SSMS, navigate to Server Objects > Linked Servers and confirm the linked server name exactly matches the name used in the query.
- Check Security mappings under the linked server properties to ensure the login context has permission to execute remote calls.
- Test connectivity by right-clicking the linked server and selecting Test Connection.
Alternative or Verification Steps
- After applying the fix, re-execute the original query or script that triggered Error 11606 and confirm it completes without the server-name validation error.
- If the error persists, check the SQL Server Error Log (
Management > SQL Server Logsin SSMS) for additional context, and verify no stale server name entries exist by runningEXEC sp_helpserver;to audit all registered server aliases.