70-464 Exam - Developing Microsoft SQL Server 2012 Databases

certleader.com

Q1. You execute usp_SelectEmployeesByName multiple times, passing strings of varying lengths to @LastName. You discover that usp_SelectEmployeesByName uses inefficient execution plans. 

You need to update usp_SelectEmployeesByName to ensure that the most efficient execution plan is used. 

What should you add at line 31 of StoredProcedures.sql? 

A. OPTION (ROBUST PLAN) 

B. OPTION (OPTIMIZE FOR UNKNOWN) 

C. OPTION (KEEP PLAN) 

D. OPTION (KEEPFIXED PLAN) 

Answer:

Explanation: 

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

Q2. You are testing disaster recovery procedures. 

When you attempt to restore ProductsDB to another server, you receive the following error message: "Msg 33111, Level 16, State 3, Line 5 Cannot find server certificate with thumbprint ' 

0x9D876A3468B911ElBA4CFCBF4724019B\ 

Msg 3013, Level 16, State 1, Line 5 

RESTORE DATABASE is terminating abnormally." 

You need to ensure that you can restore ProductsDB to another server. 

Which code segment should you execute on the other server? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q3. Topic 8) 

You are designing a database for a university. The database will contain two tables named 

Classes and StudentGrades that have the following specifications: 

. Classes will store brochures in the XPS format. . The brochures must be structured in folders and must be accessible byusing UNC paths. . StudentGrades must be backed up on a separate schedule than the rest ofthe database. 

You need to identify which SQL Server technology meets the specifications of each table. Which technologies should you identify? To answer, drag the appropriate technology to the correct table in the answer area. 

Answer:  

Q4. You create a table named Customers by using the following code segment: 

You create a non-clustered index named IX_Name on the name column. 

You write the following query to retrieve all of the customers that have a name that starts with the letters SMI: 

You discover that the query performs a table scan. You need to ensure that the query uses the index. What should you do? 

A. Replace LEFT(name,3) = 'smi' by using name like 'smi%' 

B. Replace LEFT(name,3) = 'smi' by using substring(name,l,3) = 'smi' 

C. Recreate IX_Name as a unique index 

D. Recreate IX Name as a clustered index 

Answer:

Q5. You need to resolve the performance issues of the usp_ExportOpenings stored procedure. The solution must minimize the amount of hard disk space used. 

Which statement should you execute on DB1? 

A. EXEC sp_dboption 'DB1', 'auto create statistics', 'TRUE' 

B. CREATE INDEX IX_Exp_Openings ON Openings(PostDate, FilledDate) INCLUDE 

(Description, Title, Salary); 

C. CREATE INDEX IX_Exp_Openings ON Openings(PostDate) INCLUDE (Description, 

Title, 

Salary) WHERE FilledDate IS NULL; 

D. EXEC sp_recompile 'usp_ExportOpenings' 

Answer:

Q6. You need to recommend a solution that meets the concurrency problems. 

What should you include in the recommendation? 

A. Modify the stored procedures to use the SERIALIZABLE isolation level. 

B. Modify the order in which usp_AcceptCandidate accesses the Applications table and the Candidates table. 

C. Modify the order in which usp_UpdateCandidate accesses the Applications table and the Candidates table. 

D. Modify the stored procedures to use the REPEATABLE READ isolation level. 

Answer:

Topic 6, Coho Winery 

Overview 

You are a database developer for a company named Coho Winery. Coho Winery has an office in London. 

Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries. 

The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1. 

An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe. 

A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file. 

Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities. 

You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database. 

The Sales database contains a table named Orders that has more than 20 million rows. 

Database Definitions Database and Tables 

The following scripts are used to create the database and its tables: 

Stored Procedures 

The following are the definitions of the stored procedures used in the database: 

Indexes 

The following indexes are part of the Sales database: 

Data Import 

The XML files will contain the list of items in each order. Each retailer will have its own XML schema and will be able to use different types of encoding. Each XML schema will use a default namespace. The default namespaces are not guaranteed to be unique. 

For testing purposes, you receive an XSD file from a customer. 

For testing purposes, you also create an XML schema collection named ValidateOrder. ValidateOrder contains schemas for all of the retailers. 

The new version of the application must validate the XML file, parse the data, and store the parsed data along with the original XML file in the database. The original XML file must be stored without losing any data. 

Reported Issues 

Performance Issues 

You notice the following for the usp_GetOrdersAndItems stored procedure: 

The stored procedure takes a long time to complete. 

Less than two percent of the rows in the Orders table are retrieved by 

usp_GetOrdersAndItems. 

A full table scan runs when the stored procedure executes. 

The amount of disk space used and the amount of time required to insert data are 

very high. 

You notice that the usp_GetOrdersByProduct stored procedure uses a table scan when the stored procedure is executed. 

Page Split Issues 

Updates to the Orders table cause excessive page splits on the IX_Orders_ShipDate index. 

Requirements Site Requirements 

Users located in North America must be able to view sales data for customers in North America and Europe in a single report. The solution must minimize the amount of traffic over the WAN link between the offices. 

.. .. 

Bulk Insert Requirements 

The usp_ImportOrderDetails stored procedure takes more than 10 minutes to complete. The stored procedure runs daily. If the stored procedure fails, you must ensure that the stored procedure restarts from the last successful set of rows. 

Index Monitoring Requirements 

The usage of indexes in the Sales database must be monitored continuously. Monitored data must be maintained if a server restarts. The monitoring solution must minimize the usage of memory resources and processing resources. 

Q7. Topic 7) 

You need to implement a new version of usp_AddMobileLocation. Develop the solution by selecting and arranging the required code blocks in the correct order. You may not need all of the code blocks. 

Answer:  

Q8. You have a database named database1. 

Database developers report that there are many deadlocks. 

... 

You need to implement a solution to monitor the deadlocks. The solution must meet the following requirements: 

Support real-time monitoring. 

Be enabled and disabled easily. 

Support querying of the monitored data. 

What should you implement? 

More than one answer choice may achieve the goal. Select the BEST answer. 

A. Log errors by using trace flag 1222 

B. Log errors by using trace flag 1204 

C. A SQL Server Profiler template 

D. An Extended Events session 

Answer:

Explanation: 

http://www.sqlservercentral.com/blogs/james-sql-footprint/2012/08/12/monitor-deadlock-in-sql-2012/ http://blogs.technet.com/b/mspfe/archive/2012/06/28/how_2d00_to_2d00_monitor_2d00_d eadlocks_2d00_in_2d00_sql_2d00_server.aspx 

Q9. Topic 8) 

You have a SQL Server 2012 database named DB1. DB1 contains four filegroups named FG1, FG2, FG3, and FG4. You execute the following code: 

Two million rows are added to dbo.Sales. 

You need to move the data from the first partition to a new table named SalesHistory and, starting on December 31, 2012, repartition dbo.Sales to support new sales data for three months. 

Which code segment should you execute? 

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

Answer:  

Q10. You need to create the object used by the parameter of usp_UpdateEmployeeName. 

Which code segment should you use? 

A. CREATE XML SCHEMA COLLECTION EmployeesInfo 

B. CREATE TYPE EmployeesInfo AS Table 

C. CREATE SCHEMA EmployeesInfo 

D. CREATE TABLE EmployeesInfo 

Answer:

Explanation: 

Example Usage of Table-Valued Parameters (Database Engine) http://msdn.microsoft.com/en-us/library/bb510489.aspx (Benefits of using Table-Valued Parameters) 

/* Create a table type. */ 

CREATE TYPE LocationTableType AS TABLE 

( LocationName VARCHAR(50) 

, CostRate INT ); 

GO 

/* Create a procedure to receive data for the table-valued parameter. */ 

CREATE PROCEDURE dbo. usp_InsertProductionLocation 

@TVP LocationTableType READONLY 

AS 

SET NOCOUNT ON 

INSERT INTO AdventureWorks2012.Production.Location 

(Name 

,CostRate 

,Availability 

,ModifiedDate) 

SELECT *, 0, GETDATE() 

FROM @TVP; 

GO 

Also: 

http://msdn.microsoft.com/en-us/library/ms175007.aspx(CREATE TYPE *tabletypename* 

AS 

TABLE) 

http://msdn.microsoft.com/en-us/library/ms175010.aspx(table data types) 

Wrong Answers: 

http://msdn.microsoft.com/en-us/library/ms174979.aspx(CREATE TABLE) 

http://msdn.microsoft.com/en-us/library/ms189462.aspx(CREATE SCHEMA) 

http://msdn.microsoft.com/en-us/library/ms176009.aspx(CREATE XML SCHEMA 

COLLECTION)