Q1. You have a SQL Server 2012 database named DB1 that is accessed by 650 concurrent users.
You need to log all of the queries to DB1 that become deadlocked. The solution must meet the following requirements:
. Provide a representation of the deadlock in XML format.
. Minimize the impact on the server.
What should you create?
A. A SQL Server Profiler trace
B. A SQL Server Agent job that retrieves information from the sys.dm_tran_session_transactions dynamic management views
C. A SQL Server Agent job that retrieves information from the sys.dm_tran_active_transactions dynamic management views
D. A script that enables trace flags
Answer: A
Q2. You need to recommend a disk monitoring solution that meets the business requirements.
What should you include in the recommendation?
A. An audit
B. A dynamic management view
C. A maintenance plan
D. A SQL Server Agent alert
Answer: B
Q3. You plan to create a new column in a table. The column must meet the following requirements:
Be able to store images that are larger than 1 MB each.
Be able to access the images from Microsoft .NET Framework applications.
You need to recommend which data type must be used in the column.
Which data type should you recommend?
More than one answer choice may achieve the goal. Select the BEST answer.
A. nvarchar
B. varbinary
C. image
D. FileStream
Answer: D
Q4. You are building a stored procedure for a Windows Azure SQL Database. The procedure will add multiple rows to a table.
You need to design the stored procedure to meet the following requirements:
If any of the new rows violates a table constraint, then no further additions must be attempted and all changes made by the stored procedure must be discarded.
If any errors occur, a row must be added to an audit table, and the original error must be returned to the caller of the stored procedure.
What should you include in the design?
A. An explicit transaction that has XACT_ABORT disabled
B. An implicit transaction that has error handling enabled
C. An explicit transaction that has error handling enabled
D. An implicit transaction that has XACT.ABORT enabled
Answer: C
Q5. You use SQL Server 2014. The physical server is a dedicated database server that has 120GB of RAM available. There is approximately 50GB of storage space available on a slow local disk.
You create a new stored procedure. You decide you need to temporarily hold approximately 300,000 rows from two tables, from which you will compute two complex business scores.
The stored procedure will use temporary storage defined as follows: The code will make several passes through the data, applying complex calculations before writing the data to a permanent disk-based table in the same database from which it reads the data.
For this stored procedure, you need to deal with temporary data in the most efficient way to minimize physical disk pressure.
What should you do? More than one answer choice may achieve the goal. Select the BEST answer.
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q6. You use SQL Server 2014 to maintain the data used by applications at your company.
You need to run two separate SQL statements.
You must guarantee that the following three things happen:
1. Either BOTH statements succeed or BOTH statements fail as a batch.
2. If an error occurs on the first statement, SQL should not attempt to run the second statement.
3. Error information should be returned to the client.
What should you do?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q7. You have a SQL Server 2012 database named Database1. You execute the following code:
You insert 3 million rows into Sales.
You need to reduce the amount of time it takes to execute Proc1.
What should you do?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q8. You execute the following code:
You have a stored procedure that includes the following SELECT statement:
You need to create a covering index on UserInfo. Which code segment should you execute?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Q9. You execute usp_TestSpeakers.
You discover that usp_SelectSpeakersByName uses inefficient execution plans.
You need to update usp_SelectSpeakersByName to ensure that the most efficient execution plan is used.
What should you add at line 30 of Procedures.sql?
A. OPTION (FORCESCAN)
B. OPTION (FORCESEEK)
C. OPTION (OPTIMIZE FOR UNKNOWN)
D. OPTION (OPTIMIZE FOR (@LastName= 'Anderson'))
Answer: C
Q10. You need to implement a solution that solves the performance issues of usp_GetOrdersAndItems.
Which statements should you execute?
A. CREATE INDEX IX_Orders_Active ON Orders(ShipDate, DeliveryDate, Amount)
B. CREATE INDEX IX_Orders_Active ON Orders(DeliveryDate) INCLUDE(Amount) WHERE ShipDate IS NULL
C. CREATE INDEX IX_Orders_Active ON Orders(DeliveryDate, Amount) WHERE ShipDate IS NULL
D. CREATE INDEX IX_Orders_Active ON Orders(ShipDate, DeliveryDate) INCLUDE( Amount)
Answer: B