Microsoft Querying Microsoft SQL Server 2012/2014 70-461 Exam Questions

Page: 1 / 14
Total 251 questions
Question 1

You have a database that contains the tables as shown in the exhibit. (Click the Exhibit button.)

You have the following query:

You need to recreate the query to meet the following requirements:

* Reference columns by using one-part names only.

* Sort aggregates by SalesTerritoryID, and then by ProductID.

* Order the results in descending order from SalesTerritoryID to ProductID.

* The solution must use the existing SELECT clause and FROM clause.

Which code segment should you use?

To answer, type the correct code in the answer area.



Answer : A


Question 2

You have a database named Sales that contains the tables shown in the exhibit. (Click the Exhibit button.)

You have an application named Appl. You have a parameter named @Count that uses the int data type. App1 is configured to pass @Count to a stored procedure.

You need to create a stored procedure named usp_Customers for App1 that returns only the number of rows specified by the @Count parameter.

The solution must NOT use BEGIN, END, or DECLARE statements.

Part of the correct Transact-SQL statement has been provided in the answer area. Complete the Transact-SQL statement



Answer : A


Question 3

You develop a Microsoft SQL Server 2012 database that contains a table named Products. The Products table has the following definition:

You need to create an audit record only when either the RetailPrice or WholeSalePrice column is updated.

Which Transact-SQL query should you use?



Question 4

You administer several Microsoft SQL Server 2012 database servers. Merge replication has been configured for an application that is distributed across offices throughout a wide area network (WAN). Many of the tables involved in replication use the XML and varchar (max) data types. Occasionally, merge replication fails due to timeout errors. You need to reduce the occurrence of these timeout errors. What should you do?



Answer : A


Question 5

Your application contains a stored procedure for each country. Each stored procedure accepts an employee identification number through the @EmpID parameter.

You need to build a single process for each employee that will execute the appropriate stored procedure based on the country of residence.

Which approach should you use?



Answer : E

SQL Server user-defined functions are routines that accept parameters, perform an action, such as a complex calculation, and return the result of that action as a value. The return value can either be a single scalar value or a result set.


Question 6

You are developing a database that will contain price information.

You need to store the prices that include a fixed precision and a scale of six digits.

Which data type should you use?



Answer : D


Question 7

You use Microsoft SQL Server 2012 to develop a database application.

You create a stored procedure named dbo.ModifyData that can modify rows.

You need to ensure that when the transaction fails, dbo.ModifyData meets the following requirements:

* Does not return an error

* Closes all opened transactions

Which Transact-SQL statement should you use?



Answer : D


Page:    1 / 14   
Total 251 questions