The BREAK Keyword in Transact SQL
BREAK is a useful piece of control-of-flow language in SQL Server, but it only works in specific situations.
BREAK is a useful piece of control-of-flow language in SQL Server, but it only works in specific situations.
RETURN is a “control of flow” language keyword in Transact-SQL. It’s very useful for managing when code does – and does NOT – get executed in procedural code, and it can also be used to communicate the status from procedural code.
But not everyone knows how to use RETURN, and learning about it can be awkward because of some quirks of SQL Server Management Studio. It is well worth taking the time to get used to it, though!
Copyright (c) 2025, Catalyze SQL, LLC; all rights reserved. Opinions expressed on this site are solely those of Kendra Little of Catalyze SQL, LLC. Content policy: Short excerpts of blog posts (3 sentences) may be republished, but longer excerpts and artwork cannot be shared without explicit permission.