Skip to main content Skip to Ask Learn chat experience

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge
Read in English

Note

Access to this page requires authorization. You can try signing in or changing directories.

Access to this page requires authorization. You can try changing directories.

In this article

Control-of-Flow Language (Transact-SQL)

The Transact-SQL control-of-flow language keywords are:

BEGIN...END

RETURN

BREAK

TRY...CATCH

CONTINUE

WAITFOR

GOTO label

WHILE

IF...ELSE

 

See Also

Reference

CASE (Transact-SQL)

/*...*/ (Comment) (Transact-SQL)

-- (Comment) (Transact-SQL)

DECLARE @local\_variable (Transact-SQL)

EXECUTE (Transact-SQL)

PRINT (Transact-SQL)

RAISERROR (Transact-SQL)

Concepts

Batches

Control-of-Flow

Elements of Transact-SQL

Other Resources

Handling Database Engine Errors


Additional resources


  • Last updated on 2010-10-01

In this article

en-us
Your Privacy Choices
  • AI Disclaimer
  • Previous Versions
  • Blog
  • Contribute
  • Privacy
  • Consumer Health Privacy
  • Terms of Use
  • Trademarks
  • © Microsoft 2026