70-464 Exam - Developing Microsoft SQL Server 2012 Databases

certleader.com

Q1. You have an application that uses a view to access data from multiple tables. 

You need to ensure that you can insert rows into the underlying tables by using the view. 

What should you do? 

A. Create an INSTEAD OF trigger on the view. 

B. Define the view by using the SCHEMABINDING option. 

C. Define the view by using the CHECK option. 

D. Materialize the view. 

Answer:

Explanation: 

http://msdn.microsoft.com/en-us/library/ms180800.aspx http://msdn.microsoft.com/en-us/library/ms187956.aspx 

Q2. You have a Microsoft SQL Azure database. You have the following stored procedure: 

You discover that the stored procedure periodically fails to update Person.Contact. 

You need to ensure that Person.Contact is always updated when UpdateContact executes. The solution must minimize the amount of time required for the stored procedure to execute and the number of locks held. 

What should you do? 

A. Add the following line of code to line 12: 

WITH (UPDLOCK) 

B. Add the following line of code to line 05: 

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE 

C. Add the following line of code to line 08: 

WITH (UPDLOCK) 

D. Add the following line of code to line 05: 

SET TRANSACTION ISOLATION LEVEL SNAPSHOT 

Answer:

Explanation: * Overall, you should use UPDLOCK when you read a value that you plan to update later in the same transaction to prevent the value from changing. 

* UPDLOCK Specifies that update locks are to be taken and held until the transaction completes. UPDLOCK takes update locks for read operations only at the row-level or page-level. If UPDLOCK is combined with TABLOCK, or a table-level lock is taken for some other reason, an exclusive (X) lock will be taken instead. When UPDLOCK is specified, the READCOMMITTED and READCOMMITTEDLOCK isolation level hints are ignored. For example, if the isolation level of the session is set to SERIALIZABLE and a query specifies (UPDLOCK, READCOMMITTED), the READCOMMITTED hint is ignored and the transaction is run using the SERIALIZABLE isolation level. 

Q3. You need to implement a solution that addresses the performance issues of the usp_GetOrdersByProduct stored procedure. 

Which statement should you execute? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q4. You need to identify the cause of the page split issues. 

Which SQL Server feature should you use? 

A. DBCC REINDEX 

B. SQL Server Profiler 

C. Extended Events 

D. DBCC TRACEOFF 

Answer:

46. You need to design a solution that meets the refactoring requirements. 

Which type of object should you include in the solution? 

A. An indexed view 

B. An aggregate function 

C. A distributed view 

D. A table-valued function 

Q5. You execute IndexManagement.sql and you receive the following error message: "Msg 512, Level 16, State 1, Line 12 

Subquery returned more than 1 value. This is not permitted when the subquery follows =, != ,<, <= , >, > = or when the subquery is used as an expression." 

You need to ensure that IndexManagement.sql executes properly. 

Which WHILE statement should you use at line 18? 

A. WHILE SUM(@RowNumber) < (SELECT @counter FROM @indextable) 

B. WHILE @counter < (SELECT SUM(RowNumber) FROM @indextable) 

C. WHILE COUNT(@RowNumber) < (SELECT @counter FROM @indextable) 

D. WHILE @counter < (SELECT COUNT(RowNumber) FROM @indextable) 

Answer:

Q6. You have a Microsoft SQL Azure database. 

You have the following stored procedure: 

You discover that the stored procedure periodically fails to update HR.Employees. 

You need to ensure that HR.Employees is always updated when up_employees executes. 

The solution must minimize the amount of time required for the stored procedure to execute and the number of locks held. 

What should you do? 

A. Add the following line of code to line 05: 

SET TRANSACTION ISOLATION LEVEL SNAPSHOT 

B. Add the following line of code to line 13: 

WITH (UPDLOCK) 

C. Add the following line of code to line 05: 

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE 

D. Add the following line of code to line 08: 

WITH (UPDLOCK) 

Answer:

Q7. You need to prepare the database to use the .NET Framework ProcessProducts component. 

Which code segments should you execute? (Each correct answer presents part of the solution. Choose all that apply.) 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

F. Option F 

G. Option G 

Answer: A,C,D,E 

Explanation: 

http://msdn.microsoft.com/en-us/library/ms131048.aspx http://msdn.microsoft.com/en-us/library/ms131052.aspx http://msdn.microsoft.com/en-us/library/ms189524.aspx http://msdn.microsoft.com/en-us/library/ms345106.aspx http://msdn.microsoft.com/en-us/library/ms131107.aspx 

Q8. Topic 8) 

You have a table named Customers that has a clustered index defined on the ID column. 

You write a script to create a stored procedure. 

You need to complete the script for the stored procedure. The solution must minimize the 

number of locks and deadlocks. 

What should you do? 

To answer, drag the appropriate option to the correct location in the answer area. (Answer 

choices may be used once, more than once, or not at all.) 

Answer:  

Q9. Topic 8) 

You plan to create a custom aggregation function named Median. 

You plan to deploy Median to a SQL Server 2014 server named Server1. 

You need to ensure that Median can access a web service named WebApp1. The solution 

must minimize the number of changes made to the database. 

You create a Microsoft .NET Framework class that contains the definition of Median. 

You upload a certificate to Server1. 

What three tasks should you perform next? 

To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. 

Answer:  

Q10. Developers report that usp_UpdateSessionRoom periodically returns error 3960. 

You need to prevent the error from occurring. The solution must ensure that the stored procedure returns the original values to all of the updated rows. 

What should you configure in Procedures.sql? 

A. Replace line 46 with the following code: 

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE 

B. Replace line 46 with the following code: 

SET TRANSACTION ISOLATION LEVEL REPEATABLE READ 

C. Move the SELECT statement at line 49 to line 57. 

D. Move the SET statement at line 46 to line 53. 

Answer:

Topic 3, Scenario 3 

Application Information 

You have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 has SQL Server 2008 Standard installed. 

You have an application that is used to manage employees and office space. Users report that the application has many errors and is very slow. 

You are updating the application to resolve the issues. You plan to create a new database on SQL1 to support the application. The script that you plan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use to create the stored procedures for the new database is shown in StoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides on SQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. 

A stored procedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The stored procedures executing usp_UpdateEmp!oyeeName will always handle transactions. 

A stored procedure named usp_SelectEmployeesByName will be used to retrieve the names of employees. Usp_SelectEmployeesByName can read uncommitted data. 

A stored procedure named usp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future. 

StoredProcedures.sql 

Indexes.sql Tables.sql