70-461 Querying Microsoft SQL Server 2012

Loading demo links...

Showing 7–9 of 15 questions

Question 7

You administer a Microsoft SQL Server database that supports a shopping application.

You need to retrieve a list of customers who live in territories that do not have a sales person.

Which Transact- SQL query or queries should you use? (Each correct answer presents a complete solution. Choose all that apply.)

Select all that apply, then click Submit answer.

  • SELECT CustomerID FROM Customer
    WHERE TerritoryID <> SOME(SELECT TerritoryID FROM Salesperson)

  • SELECT CustomerID FROM Customer
    WHERE TerritoryID <> ALL(SELECT TerritoryID FROM Salesperson)

  • SELECT CustomerID FROM Customer
    WHERE TerritoryID <> ANY(SELECT TerritoryID FROM Salesperson)

  • SELECT CustomerID FROMCustomer
    WHERE TerritoryID NOT IN(SELECT TerritoryID FROM Salesperson)

Question 8

You have a vendor application that uses a scalar function.

You discover that the queries for the application run slower than expected.

You need to gather the runtime information of the scalar function.

What are two possible ways to achieve this goal? Each correct answer presents a complete solution.

Select all that apply, then click Submit answer.

  • Enable the Include Actual Execution Plan option.

  • Enable the Display Estimated Execution Planoption.

  • Create and then enable a profiler trace.

  • Create and then enable an extended events trace.

  • Run the Database Engine Tuning Advisor.

Question 9

You administer a Microsoft SQL Server database that has Trustworthy set to On. You create a stored procedure that returns database-level information from Dynamic Management Views. You grant User1 access to execute the stored procedure. You need to ensure that the stored procedure returns the required information when User1 executes the stored procedure. You need to achieve this goal by granting the minimum permissions required. What should you do? (Each correct answer presents a complete solution. Choose all that apply.)

Select all that apply, then click Submit answer.

  • Create a SQL Server login that has VIEW SERVER STATE permissions. Create an application role and a secured password for the role.

  • Modify the stored procedure to include the EXECUTE AS OWNER statement. Grant VIEW SERVER STATE permissions to the owner of the stored procedure.

  • Create a SQL Server login that has VIEW SERVER STATE permissions. Modify the stored procedure to include the EXECUTE AS {newlogin} statement.

  • Grant the db_owner role on the database to User1.

  • Grant the sysadmin role on the database to User1.