Previous | Table of Contents | Next |
You learned the basic syntax of the SELECT statement today, which is the only way to retrieve data from a SQL Server. You learned how to get a set of columns from a table, and how to sort the rows of data coming back with the ORDER BY predicate.
You saw how to get help from the system on tables and the columns they contain. You got a little information about errors and messages, and you learned how to handle some of the more common ones.
Q Is there a limit to the number of columns I can list in a single select statement?
A SQL does not impose a limit, but the most columns that a table can have is 255.
Q Whats the difference between a raiserror and a print, and when would I use them?
A RAISERROR is used to indicate an exception. When things go wrong, RAISERRORS give the user an idea about what happened, and how to fix it. RAISERROR allows you to specify an error number, severity, and state. PRINT is used to give supplemental information. You can use PRINT to confirm that things succeeded.
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.
select au_fname, au_lname from authors select title_id, title from titles select * from titles
Previous | Table of Contents | Next |