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

Troubleshooting Guide: SQL Server Error 4841

Why This Error Happens

Error 4841 occurs when a Transact-SQL statement—most commonly CREATE FULLTEXT CATALOG, sp_addlinkedserver, or EXTERNAL DATA SOURCE definitions—receives a multi-part identifier (e.g., dbo.MySource or Server.Database.Name) where SQL Server strictly requires a single, simple object name. This is frequently triggered by copy-pasted scripts from legacy SQL Server versions or ORM-generated DDL that includes schema prefixes or bracketed qualifiers around the data source name. It can also occur in Windows Server 2025 deployments where PolyBase or external data source configurations reference a linked server name formatted with dots or slashes instead of a flat string.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement

  • Open SQL Server Management Studio (SSMS) and locate the exact line from the error message in your script or application log.
  • Check for any data source name wrapped with schema qualifiers, such as dbo.ExternalSource or [Server].[Source].
  • Run SELECT * FROM sys.messages WHERE message_id = 4841; to confirm the exact wording for your installed build.

Step 2: Correct the Object Name Syntax

  • Remove any multi-part naming and replace with a single, bracket-escaped simple identifier.
  • Example fix for a PolyBase external data source:
CREATE EXTERNAL DATA SOURCE [MyDataSource]
WITH (
    LOCATION = 'sqlserver://ServerName'
);
  • Ensure the name does not contain periods (.), backslashes (\), or forward slashes (/) unless they are part of a correctly bracketed single-name exception.

Step 3: Validate Linked Server or Catalog Configuration

  • If the error originates from sp_addlinkedserver, confirm the @server parameter is a flat string with no embedded dots:
EXEC sp_addlinkedserver 
    @server = 'MyLinkedServer', 
    @srvproduct = '', 
    @provider = 'SQLNCLI', 
    @datasrc = 'RemoteServerName';
  • On Windows Server 2025, check C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the exact statement that triggered the failure.

Step 4: Restart the Affected Service

  • After correcting the script, restart the SQL Server instance via services.msc or run:
Restart-Service -Name 'MSSQLSERVER' -Force
  • Re-execute the corrected script in a fresh SSMS session to avoid cached parse errors.

Alternative or Verification Steps

  • Re-run the corrected CREATE EXTERNAL DATA SOURCE or sp_addlinkedserver statement and confirm no error is returned; then query sys.external_data_sources or sys.servers to verify the object was created successfully.
  • If the issue persists, use sp_helpserver to inspect existing linked server entries for legacy naming conflicts and drop/recreate any entries using fully simple names.