How to Fix SQL Server Error 10772 (Msg 10772)

Published
Length
3 min read

Luis Felipe Dias

All posts

You trigger sql server error 10772 when a query uses multiple REMOTE_DATA_ARCHIVE_OVERRIDE hints on one table or view. To fix this error, remove the extra remote data archive override hints from the query reference. This failure is a syntax and query rule issue with a severity level of 15. The database engine stops the query before it runs any changes. You must clean up the table or view hints to make the query run. What causes sql server error 10772 in your database In SQL Server, message 1

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 trigger sql server error 10772 when a query uses multiple REMOTE_DATA_ARCHIVE_OVERRIDE hints on one table or view. To fix this error, remove the extra remote data archive override hints from the query reference.

This failure is a syntax and query rule issue with a severity level of 15. The database engine stops the query before it runs any changes. You must clean up the table or view hints to make the query run.

What causes sql server error 10772 in your database

In SQL Server, message 10772 carries a severity level of 15. Severity 15 means the error comes from a syntax rule in your command. Specifically, the query parser finds more than one REMOTE_DATA_ARCHIVE_OVERRIDE hint on the same table or view reference.

The database engine allows only one override hint per table or view in a single statement. When an app or engineer writes a query with duplicate hints, the parser rejects it right away. This often happens when dynamic query builders append hints without checking existing ones.

It can also happen when views and outer queries conflict during query compilation. If a script adds a second hint to a single table reference, the engine raises message 10772. Because the parser catches this early, the database does not read or write any rows.

How to find and fix the duplicate hint in production

To fix this error, inspect the exact query text that failed. Look at every table and view reference in the statement. Check the hints attached to each table or view name.

Find the table or view that lists the REMOTE_DATA_ARCHIVE_OVERRIDE hint more than once. Delete the extra hint so that only one override hint remains on that reference. If an app builds the query, update the code that appends table hints.

When you check production queries, use an account with safe, minimal rights. A database user is the identity of a login when it connects to a database. If a person needs access to one or a few databases, a contained database user is an option. An admin must first turn on contained databases on the server and the database.

Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

For people who need access to many databases on an instance, a login in master is common. Do not grant the db_owner role just to inspect queries or view definitions. Members of db_owner can do all maintenance tasks and can even drop the database.

Instead, use the db_datareader fixed role when you only need to read user tables and views. If someone must edit data after fixing the query, the db_datawriter role lets them add, delete, or change data. You cannot change the permissions assigned to fixed database roles, so pick the role that fits the task.

Preventing hint errors in automated scripts and apps

Many teams see message 10772 after a code release or a batch script update. Automated report builders often join multiple query parts together. If two parts add the same archive override hint to one table, the final query fails.

Review your query templates and data access layers to keep hints in one place. Test your scripts in a staging database before you run them in production. Also check that your data masking rules still rewrite sensitive fields like emails, phone numbers, card numbers, or national IDs in query results.

Keep database access tight while your team fixes broken scripts. Use read-only roles for diagnosis, and log every query change before you deploy it.

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 15 mean for SQL Server error 10772?

Severity 15 means the error is a syntax or command error in the query text. An engineer or app developer can fix it by editing the SQL statement.

How do I resolve Msg 10772 in a failed query?

Check the table and view references in your query for multiple REMOTE_DATA_ARCHIVE_OVERRIDE hints. Remove the duplicate hints so each table or view reference has at most one override hint.

Do I need db_owner permissions to troubleshoot query hint errors?

No, you do not need db_owner rights to check and fix query syntax. You can test read queries with the db_datareader role, which lets you read all user tables and views safely.

The query runs. The emails stay hidden.