Home >> FAQs/Tutorials >> SQL Server FAQ
SQL Server FAQs - Transact-SQL Conditional Statements and Loops
A collection of 5 FAQs on Transact-SQL language conditional statements and loops. Clear answers are provided with tutorial exercises on IF ... ELSE statements; WHILE loops; statement blocks; BREAK and CONTINUE statements.
Topics included in this FAQ are:
- How To Use "IF ... ELSE IF ... ELSE ..." Statement Structures?
- How To Use "BEGIN ... END" Statement Structures?
- How To Use WHILE Loops?
- How To Stop a Loop Early with BREAK Statements?
- How To Skip Remaining Statements in a Loop Block Using CONTINUE Statements?
Please note that all answers and tutorials are based on MS SQL Server 2005.
To follow tutorials in this collection, you should connect to SQL server
as a regular user who has enough permissions to run simple Transact-SQL statements.
Some tutorial exercises use the sample database AdventureWorksLT provided by Microsoft.
For questions on Transact-SQL language, see the other FAQ collections.
(Continued on next topic...)