Day 11

Quiz

1:Name the five steps that the server must perform when a batch of SQL statements is sent for execution.
A1: Parse:syntax, Parse:object references, Optimize, Compile, and Execute.
2:What are two of the major flow of control statements that you can use?
A2: IF, WHILE.
3:What value does the variable @@ERROR contain?
A3: It contains the last error code returned by the server. If no error has occurred, it will contain a zero.

Exercise

1:Write a SQL statement that displays the current version of SQL Server.
A1: The @@Version system stored procedure is used to display the current version of the SQL Server
Select @@Version

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.