r/SQL • • 2d ago

SQL Server SQL Server Agent job fails with Error 233 when loading data through a Linked Server, but the same query works in SSMS

/r/Database/comments/1xvf9qv/sql_server_agent_job_fails_with_error_233_when/
2 Upvotes

7 comments sorted by

2

u/Significant_Tune9219 2d ago

Error 233 over the Shared Memory provider points at the connection from the Agent context rather than row volume. SSMS runs as your own login while the job runs as the domain service account, so check the linked server's login mapping for that account, since the security context it connects with can differ. Also look at the SQL Server error logs on both servers around the failure time for connection resets, and check the linked server's query timeout and connection timeout settings. Does the failure happen at a consistent point in the load or at random?

1

u/Various-Strawberry55 21h ago

The failure happens during insertion..I'm doing truncate load

1

u/SQLDevDBA 1d ago

Any chance this was after a most recent windows update? There’s a November 2026 update that affected Linked Server and OLEDB queries.

Otherwise I’d start checking the Linked Server settings, and perhaps ensuring the query you’re pulling is as optimized as possible.

https://www.bleepingcomputer.com/news/microsoft/microsoft-recent-windows-updates-cause-sql-server-performance-issues/amp/

2

u/Various-Strawberry55 1d ago

This could be it. I restarted the server on 11th Nov, and shortly after the query started failing on the SQL Server Agent.

Is there any solution to this?

1

u/SQLDevDBA 1d ago

AFAIK just a rollback of the KB and another reboot. I saw this article after my colleague sent it to me and decided to wait for a fix.

1

u/Discordbothost 16h ago

Microsoft lists a Support for business mitigation while a fix is pending. check your OS/build against the advisory; Error 233 alone doesn't prove this is the same bug.

https://learn.microsoft.com/en-us/windows/release-health/status-windows-server-2022

0

u/karmatics29 2d ago

The "Shared Memory Provider" part is the useful clue. That is the job step's own local connection to your instance being dropped, not the link to the remote server. So the session got killed server-side mid-INSERT, which usually means something crashed or was terminated inside the engine rather than a network problem with the linked server.

Things I'd check, in order:

  1. The SQL Server ERRORLOG on the local instance at the exact job failure time. Look for a stack dump, access violation or "non-yielding" message. Linked server OLE DB providers often run in-process, so a provider fault can take the session down with it.

  2. Which provider the linked server uses. If it's still SQLNCLI, switch to MSOLEDBSQL. Also look at "Allow inprocess" under Server Objects > Linked Servers > Providers.

  3. Security mapping. In SSMS the linked server runs as your login; under Agent it runs as the job owner/service account mapping. A permissions issue normally gives a clean login error, not 233, but it's worth confirming the mapping is identical.

  4. The remote server's log too, in case it's closing the connection (memory pressure, timeouts on a wide 60+ column pull).

Batching "working" fits a resource or provider problem rather than a hard row limit. I'd treat it as a workaround until the error log tells you what actually killed the session.