Previous | Table of Contents | Next |
Q Does SQL have a GOTO statement?
A No. Well, OK, it does. Ive never been a big fan of GOTO. Much later in the book, there will be an example that uses GOTO to save some time and solve a problem with a little more clarity. Generally speaking, however, GOTO creates more trouble than its worth. You can write miles of great SQL without ever coming near GOTO. Concentrate your efforts on mastering the other flow control statements, and you wont be sorry.
Q Can I create local arrays of variables?
A No.
Q Just WHILE and IF? Arent there CASE statements, DO UNTIL, FOR NEXT, any of those commands?
A No. You would be surprised how much work you can do with just IF and WHILE. There is a CASE expression, but this is not used for flow control. The CASE expression is most often used for conditional execution inside a SELECT or UPDATE statement.
Q Is there a limit to the number of nested IF statements I can write?
A As of MS SQL Server v6.5, there is a limit of 294 nested IF s. Practically speaking, if you hit this limit in the normal course of SQL programming, something has gone horribly wrong. There is no predefined limit to nesting levels of the IF statement, so this limit may vary between platforms and versions of the SQL Server software.
The Workshop provides quiz questions to help you solidify your understanding of the material covered, as well as exercises to provide you with experience in using what youve learned. Try to understand the quiz and exercise answers before continuing on to the next days lesson. Answers are provided in the appendix.
Previous | Table of Contents | Next |