SQL Server Error 1091: Fix Invalid Option Step-by-Step
In this article
SQL Server error 1091 ("The option is not valid for this") appears when you run a statement that references a configuration option or argument that does not exist, is misspelled, or is not allowed in that context. The fastest fix is to check the exact option name and the command syntax, then run the corrected statement. The steps below walk through diagnosing the message, correcting the most common causes, and confirming the change.
What You'll Need
- Access to SQL Server Management Studio (SSMS), Azure Data Studio, or another client that can run T-SQL.
- Permissions to run the statement you are attempting. Changing server configuration options typically requires ALTER SETTINGS permission (members of sysadmin or serveradmin roles have it).
- The exact text of the statement that produced the error, including the option name and any surrounding keywords.
- Knowledge of which SQL Server version you are targeting, because some options exist only in certain versions.
Step-by-Step
- Read the full error message. Error 1091 is usually followed by the specific option or argument that SQL Server rejected. Note that text exactly; it tells you whether the problem is a misspelled option, an option used in the wrong command, or an option that does not exist in your version.
- Confirm the statement type. Options are validated differently depending on the command.
sp_configureaccepts server-level configuration options, whileALTER DATABASE SCOPED CONFIGURATIONaccepts a smaller set of database-scoped options. Using a server option in a database-scoped command (or the reverse) produces this error. Check that the command you are using is the one that supports the option. - Check the spelling and exact wording of the option. SQL Server option names are specific. For example,
max degree of parallelismis a server option used withsp_configure, whileMAXDOPis the hint or database-scoped keyword. Mixing the two forms in the wrong command triggers error 1091. Compare your text against the official documentation for your SQL Server version. - Verify the option exists in your version and edition. Some options are introduced in later versions or are limited to certain editions. If you copied a script written for a newer SQL Server, an option may not be recognized on an older instance. Run
SELECT @@VERSIONto confirm the version, then check the option against that version's documentation. - Check for deprecated or removed options. Microsoft has removed or deprecated several configuration options over time. If the option appears in old scripts or forums, confirm it is still valid before using it. If it has been removed, the replacement is usually documented alongside the deprecation notice.
- Correct the statement and re-run it. Fix the option name, command type, or version mismatch identified above. Run the corrected statement in a test environment first if it changes server behavior. For
sp_configure, remember that some options requireRECONFIGUREorRECONFIGURE WITH OVERRIDEbefore they take effect. - Confirm the change took effect. Re-run the statement that reads the current configuration (for example,
sp_configurewith no arguments, or the relevantsyscatalog view) and verify the value. If the value did not change, check for a pendingRECONFIGUREor a permissions issue.
Common Mistakes
- Using a server option in a database-scoped command. Options such as
max degree of parallelismbelong tosp_configure; database-scoped configuration uses different names. Mixing them is a frequent cause of error 1091. - Assuming an option exists because it appears in a script. Scripts copied from other environments may target a different SQL Server version or edition. Always verify against your own instance.
- Forgetting
RECONFIGURE. The statement may succeed but the setting stays pending until you runRECONFIGURE. This is not the cause of error 1091 itself, but it is a common follow-on confusion. - Misspelling multi-word options. Options with spaces must match exactly when passed to
sp_configure; extra spaces or different capitalization of internal words can cause rejection. - Ignoring the second line of the error. Error 1091 often includes the offending token. Reading only the first line can send you down the wrong path.
Tips
- Keep a copy of the original failing statement. Comparing it side by side with the corrected version makes the mistake obvious and helps you avoid repeating it.
- Use the official Microsoft documentation for your exact SQL Server version when checking option names. Documentation pages are version-specific and list which commands accept each option.
- Test configuration changes on a non-production instance first. Some options affect performance or behavior across the whole server.
- When scripting for multiple versions, guard version-specific options with a check of
@@VERSIONorSERVERPROPERTYso the script does not fail on older instances. - If you are unsure whether an option is server-scoped or database-scoped, search the documentation for the option name and note which command it appears under.
Troubleshooting
If the corrected statement still returns error 1091, work through these checks in order:
- Re-read the error text. The option name in the message may differ from what you think you typed. Copy it exactly and search for it.
- Confirm the command context. Some options are valid only at the server level, others only at the database level. If you are in the wrong database context, switch to the correct one and try again.
- Check permissions. A permissions problem usually produces a different error, but if the statement is being run under a low-privilege login, confirm the login has the rights to run the command at all.
- Look for hidden characters. Copying from web pages or documents can introduce non-breaking spaces or smart quotes. Retype the option name manually if the statement looks correct but still fails.
- Verify the version and edition. If the option is documented only for a newer version or a higher edition, it will not be recognized on your instance. Use the version-appropriate alternative or upgrade path.
- Check for a removed option. If the option no longer appears in current documentation, it may have been removed. Look for the replacement option in the deprecation notes.
- Start with a minimal statement. Reduce the statement to the smallest form that still produces the error. This isolates whether the problem is the option itself or surrounding syntax.
Frequently Asked Questions
What does SQL Server error 1091 mean exactly?
It means SQL Server did not recognize the option or argument you supplied in that command, or the option is not permitted in that context. The message usually names the rejected token.
Is error 1091 caused by a permissions problem?
Usually not. Permissions issues typically produce a different error number. Error 1091 is about the option name or command context, not access rights.
Why does a script work on one server but fail with 1091 on another?
The two servers likely run different SQL Server versions or editions, and the option may not exist or may be named differently on the older or lower edition instance.
Do I need to restart SQL Server after fixing the statement?
Most configuration options take effect after RECONFIGURE. A few require a service restart, which the documentation for that specific option will state. Do not restart unless the documentation says it is needed.
Can I use sp_configure for any option?
No. sp_configure covers server-level configuration options. Database-scoped options use ALTER DATABASE SCOPED CONFIGURATION, and using the wrong command for an option can produce error 1091.
Where can I find the correct option name for my version?
Use the official Microsoft documentation for your SQL Server version. Each option page lists the commands that accept it and any version or edition restrictions.