How to Fix SQL Server Error 10770 (Msg 10770)

Published
Length
3 min read

Luis Felipe Dias

All posts

You get sql server error 10770 when you turn on remote data archiving without required options. You fix it by adding the server option and a valid credential or service account option. Database teams see this message when they alter a database to use remote storage. The database engine stops the command before any changes happen. It checks your statement syntax first and flags the missing pieces right away. What causes sql server error 10770 in the database engine This failure is a severity

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 10770 when you turn on remote data archiving without required options. You fix it by adding the server option and a valid credential or service account option.

Database teams see this message when they alter a database to use remote storage. The database engine stops the command before any changes happen. It checks your statement syntax first and flags the missing pieces right away.

What causes sql server error 10770 in the database engine

This failure is a severity 15 message with message number 10770. Severity 15 means there is a syntax mistake in your SQL command. A user or script left out required words when setting up remote data archiving.

The engine requires two main parts when you turn on the remote data archive setting. First, you must provide the server option so the database knows the remote destination. Second, you must provide either a credential option or turn on the federated service account option.

If you leave out the server name, the engine raises sql server error 10770. If you give the server name but skip the login method, it fails too. Both parts must sit in the same command for the parser to accept it.

Automated deployment scripts often hit this error during setup runs. A team might pass an empty variable for the remote server address. Or a script template might miss the credential clause for a new database.

How to diagnose and fix the failure in production

Start by reading the exact SQL statement that caused the failure in your logs. Check the section that turns on the remote data archive feature. Look for the server option and verify it has a valid remote endpoint value.

Next, check how the statement handles the login to that remote endpoint. Make sure the command includes either a scoped credential or the federated service account setting. Pick the one method that matches your team security rules and add it.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Do not fix this issue by giving engineers broad server roles in production. For example, members of the db_owner fixed role can run all maintenance tasks. Still, members of the db_owner role can also drop the entire database in SQL Server.

You cannot change the permissions assigned to fixed database roles. Instead, keep engineers in read-only roles while they check the system state. Members of db_datareader can read all data from all user tables and views.

If someone only needs access to one or a few databases, use a contained user. An admin must first turn on contained databases on the server and the database. For access to many databases on an instance, a login in master is common.

How to prevent syntax and permission mistakes during database changes

Review all database change scripts in a test setup before running them in production. A quick syntax check catches severity 15 errors before a maintenance window starts. Make sure every variable in your deployment script holds a real value.

Limit who can run alter database commands on live servers. Most developers only need to read table data or check basic views. Put those users in the db_datareader role instead of giving them admin rights.

When a script fails with message 10770, fix the statement text directly. Add the missing server target and the credential or service account setting. Then run the reviewed command through your normal change process.

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 message 10770?

Severity 15 means the error is a syntax problem in the SQL command you sent. You can fix it by rewriting the statement to include all required options.

Which options are required to clear message 10770?

You must include the server option when setting up a remote data archive. You must also include either a credential option or turn on the federated service account option.

Should I grant db_owner to let a developer fix this error?

No, because members of db_owner can drop the database and change all settings. Keep developers in read-only roles like db_datareader and run the fix through controlled deployment scripts.

The query runs. The emails stay hidden.