70-761 Querying Data with Transact-SQL

Loading demo links...

Showing 10–12 of 14 questions

Question 10

You run the following Transact-SQL statement:

You need to create a query that returns the total number of attendees for each combination of CourseID, CourseDate, and the following locations: Lisbon, London, and Seattle. The result set should resemble the following:

Which Transact-SQL code segment should you run?

Select an option, then click Submit answer.

  • Option A

  • Option B

  • Option C

  • Option D

Question 11

You are performing a code review of stored procedures. Code at line SP03 fails to run (Line numbers are included for reference only.)

You need to ensure that transactions are rolled back when an error occurs.

Which Transact-SQL segment should you insert at line SP07?

Select an option, then click Submit answer.

  • If @@Error <> 0

  • If @@ TRANCOUNT = 0

  • If @@ TRANCOUNT > 0

  • If @@ Error = 0

Question 12

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You create a table named Products by running the following Transact-SQL statement:

You have the following stored procedure:

You need to modify the stored procedure to meet the following new requirements:

Insert product records as a single unit of work.

Return error number 51000 when a product fails to insert into the database.

If a product record insert operation fails, the product information must not be permanently written to the database.

Solution: You run the following Transact-SQL statement:

Does the solution meet the goal?

Select an option, then click Submit answer.

  • Yes

  • No