Server Interaction  «Prev  Next»

SQL Server[Transactions] - Quiz

Each question is worth one point. Select the best answer for each question.
 

1. Which of the following Transact-SQL statements is NOT an accurate variable declaration?
Please select the best answer.
  A. DECLARE @x varchar
  B. DECLARE @x int
  C. DECLARE @x myusertype
  D. DECLARE @@x int

2. John wants to return the database name for database ID 1. He decides to use the DB_NAME function and pass the ID. Which of the following statements could he use?
Please select the best answer.
  A. DB_NAME (1)
  B. DB_NAME 1
  C. SELECT DB_NAME (1)
  D. SELECT DB_NAME 1

3. What is wrong with the following Transact-SQL statement:
RAISERROR ('An error occurred', 19, 1)
Please select the best answer.
  A. Nothing is wrong. The statement will work correctly.
  B. You cannot specify text in the RAISERROR statement. You need to specify a number.
  C. The statement is missing the WITH LOG option.
  D. The severity is outside the range of allowable values.

Correct answers:

Your Score: 0