Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

SQL Server Error 1235: Transaction Priority Not Supported

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Error 1235 in SQL Server means you tried to use the SET TRANSACTION PRIORITY statement, which SQL Server does not support. The fix is to remove that statement from your code and use SQL Server's native concurrency controls instead, such as transaction isolation levels, locking hints, or application-level prioritization. This guide explains why the error occurs, how to find and remove the offending code, and what to use in its place.

What You'll Need

  • Access to the SQL Server instance and the database where the error occurs.
  • Permission to view and modify the stored procedures, triggers, or application code that contains the statement.
  • A SQL client such as SQL Server Management Studio (SSMS) or Azure Data Studio.
  • Basic familiarity with T-SQL and transaction isolation levels.

Step-by-Step

  1. Confirm the error source. Run the failing query or application action and capture the full error message. Error 1235 typically reads: “SET TRANSACTION PRIORITY is not supported on this SQL Server instance.” Note the line number or procedure name if provided.
  2. Search for the statement in your code. Use your source control or a script to search for SET TRANSACTION PRIORITY (case-insensitive) across stored procedures, triggers, functions, and application code. In SSMS, you can right-click a database and choose Tasks > Generate Scripts to script out objects, then search the generated file. Alternatively, query sys.sql_modules:
    SELECT OBJECT_NAME(object_id) AS ObjectName, definition
    FROM sys.sql_modules
    WHERE definition LIKE '%TRANSACTION PRIORITY%';
  3. Remove or comment out the statement. Open the offending object in SSMS or your code editor and delete the SET TRANSACTION PRIORITY line. If it is inside a stored procedure, use ALTER PROCEDURE to apply the change. If it is in application code, update the source and redeploy.
  4. Replace with a supported alternative. SQL Server does not have a direct equivalent. Instead, control concurrency using:
    • Isolation levels: Use SET TRANSACTION ISOLATION LEVEL with READ COMMITTED, REPEATABLE READ, SERIALIZABLE, or SNAPSHOT to control locking and blocking behavior.
    • Locking hints: Apply table hints such as ROWLOCK, UPDLOCK, or HOLDLOCK to specific queries.
    • Application-level prioritization: If you need to prioritize certain transactions, implement a queue or use a separate connection pool with higher priority in your application tier.
  5. Test the change. Run the previously failing query or application action in a development environment. Verify that it completes without error and that concurrency behavior meets expectations. Use tools like SQL Server Profiler or Extended Events to monitor blocking and deadlocks if needed.
  6. Deploy to production. After testing, apply the changes to your production environment. Monitor for any performance or concurrency issues that may arise from the new isolation level or hints.

Common Mistakes

  • Assuming the statement is valid in all SQL Server versions. SET TRANSACTION PRIORITY is not part of T-SQL and is not supported in any SQL Server version. It may appear in code ported from another database system.
  • Searching only stored procedures. The statement could be in ad-hoc queries, triggers, or application code. Search all sources.
  • Using SET TRANSACTION PRIORITY with a variable or dynamic SQL. Even if constructed dynamically, it will still fail. Remove it entirely.
  • Forgetting to refresh dependent objects. After altering a stored procedure, ensure applications use the updated version. Use sp_refreshsqlmodule if needed.
  • Overlooking case or spacing variations. The error may be triggered by SET TRANSACTION PRIORITY with extra spaces or different casing. Use a case-insensitive search.

Tips

  • Before modifying production code, test changes in a non-production environment that mirrors your production workload.
  • Document why the statement was removed and what alternative was used, to help future maintainers.
  • If you are migrating from another database system, review the code for other unsupported statements. Tools like SQL Server Migration Assistant (SSMA) can help identify them.
  • Consider using Query Store to monitor performance before and after changing isolation levels.
  • For high-concurrency systems, evaluate whether snapshot isolation (if enabled) could reduce blocking without the need for priority settings.

Troubleshooting

  • Error persists after removing the statement: Check for dynamic SQL or code in jobs, triggers, or linked servers that may still contain the statement. Use SQL Server Profiler to trace the exact statement being executed.
  • Cannot find the statement: The error may originate from a client application that sends the statement directly. Review application logs and connection strings. Use Extended Events to capture the SQL text.
  • Performance degrades after change: The new isolation level or hints may cause increased blocking or deadlocks. Analyze wait statistics and adjust isolation levels or add indexes to reduce contention.
  • Permission issues when altering objects: Ensure you have ALTER permission on the stored procedure or table. If not, ask a database administrator to make the change.
  • Error occurs only in certain environments: Compare SQL Server versions and compatibility levels. Although the statement is never supported, other differences may affect behavior.

Frequently Asked Questions

What does error 1235 mean?

Error 1235 indicates that the SET TRANSACTION PRIORITY statement is not supported by SQL Server. It is not a valid T-SQL command.

Is SET TRANSACTION PRIORITY supported in any SQL Server version?

No, it is not part of the T-SQL language and is not supported in any SQL Server version, including Azure SQL Database.

How can I prioritize transactions in SQL Server?

SQL Server does not have a built-in transaction priority feature. You can influence concurrency using isolation levels, locking hints, and application-level queuing or resource governor.

Can I use Resource Governor to prioritize workloads?

Resource Governor can allocate CPU and memory resources to different workload groups, which can indirectly prioritize transactions, but it does not provide per-transaction priority.

What should I do if I inherited code with this statement?

Remove the statement and replace it with appropriate isolation levels or locking hints. Test thoroughly to ensure concurrency requirements are met.

Will removing the statement break my application?

Since the statement causes an error, removing it will allow the code to run. However, you must ensure that the replacement concurrency controls meet your application's needs.