How to Fix SQL Server Error 7357 (Msg 7357)
You get sql server error 7357 when a linked server query returns no columns. Fix it by ensuring the remote query outputs a valid dataset and checking rights. This failure has a severity level of 16 in the database engine. The engine states it cannot process the target object on the linked server. The OLE DB provider indicates the object has no columns or lacks permissions. Teams often see this when running pass-through queries against remote database instances. Root causes of sql server error
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get sql server error 7357 when a linked server query returns no columns. Fix it by ensuring the remote query outputs a valid dataset and checking rights.
This failure has a severity level of 16 in the database engine. The engine states it cannot process the target object on the linked server. The OLE DB provider indicates the object has no columns or lacks permissions. Teams often see this when running pass-through queries against remote database instances.
Root causes of sql server error 7357 in linked servers
Linked server queries expect a clear set of columns back from the remote source. The OLE DB provider checks the target object before it runs the full query. If the remote statement does not return column metadata, the provider stops right away. This triggers message 7357 and halts the entire batch in your local session.
Data change commands are the most common cause of this specific linked server error. When you run an update, insert, or delete inside a pass-through function, it fails. Those commands change rows on the remote side, so they return zero columns. Temporary tables or session settings in the remote batch can also confuse metadata checks.
Missing user permissions on the remote database are the second major cause here. A database user is the identity of a login when it connects to a database. If that remote user cannot view the table metadata, the provider sees zero columns. For instance, members of a deny role cannot read user tables, views, or metadata.
Account types also shape how a linked server logs into the target system. A standard SQL user tied to a login in master can reach many databases. A contained database user has a password and is not tied to master. An admin must enable contained databases on the server and database before using this.
How to diagnose and fix the failure in production
Start your check by testing the exact remote query directly on the target database. Log in with the same account that the linked server uses for its link. Check if the query returns a normal table of rows and columns to you. If the query only writes data, move it out of a read-only pass-through call.
Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
If the remote statement must run multiple steps, ensure the final step returns rows. Also check if row count messages on the remote session hide the column structure. Turning off row count messages in the remote batch often clears up provider confusion. This lets the OLE DB provider see the real result set right away.
Next, check the database roles assigned to the remote user on the target instance. All roles, including the public role, have basic connect rights by default. Still, connect rights alone do not let the OLE DB provider read table columns. You cannot change the permissions assigned to fixed database roles in the engine.
Grant the lowest privilege needed instead of giving out full database owner rights. A database owner can do all maintenance tasks and can even drop the database. Instead, use the fixed data reader role so the user can read user tables. If the linked server must change data, add the fixed data writer role too.
Also make sure the user is not in a deny data reader role. That role blocks all reads from user tables and hides their metadata from providers. Keeping permissions tight and ensuring queries return columns will stop error 7357 for good. Your team can then run cross-server queries without risking production data safety.
Check SQL Server batches and results on the wire
SQL Server logins and roles decide who connects. They do not check what each TDS batch does or mask sensitive values in returned rows. With hoop.dev, you run an open-source proxy, a sidecar for your SQL Server, inline in the TDS wire protocol. On every batch an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
Before a batch hits the server, hoop.dev guardrails refuse disallowed actions with a native TDS error or hold risky statements for approval. On the way back, hoop.dev data masking rewrites sensitive values in supported result columns in memory, and every decision is logged. Explore the MIT-licensed project on GitHub.
Frequently asked questions
What does severity 16 mean for SQL Server error 7357?
Severity 16 means the error comes from a user mistake or query issue. It does not point to a crash or hardware failure in the database engine. You can fix it by changing the query text or updating user roles.
Why does an update query cause Msg 7357 on a linked server?
Row-reading pass-through functions expect a table of results back from the OLE DB provider. An update statement modifies data and does not send back a set of columns. The provider sees no columns in the response and raises error 7357.
Which role should a linked server user have to read remote tables?
Assign the remote user to the fixed data reader role on the target database. Members of this role can read all data from all user tables and views. Avoid using the database owner role, which gives way too much control.
Related guides
In this post