Q1. You need to recommend a disaster recovery strategy for the Inventory database.
What should you include in the recommendation?
A. Log shipping
B. SQL Server Failover Clustering
C. AlwaysOn availability groups
D. Peer-to-peer replication
Answer: A
Q2. Your company has a SQL Azure subscription.
You implement a database named Database1. Database1 has two tables named Table1 and Table2.
You create a stored procedure named sp1. Sp1 reads data from Table1 and inserts data into Table2.
A user named User1 informs you that he is unable to run sp1.
You verify that User1 has the SELECT permission on Table1 and Table2.
You need to ensure that User1 can run sp1. The solution must minimize the number of permissions assigned to User1.
What should you do?
A. Change sp1 to run as the saUser.
B. Grant User1 the EXECUTE permission on sp1.
C. Add User1 to the db_datawriter role.
D. Grant User1 the INSERT permission on Table2.
Answer: B
Q3. You have four databases that are accessed by using an Online Transaction Processing (OLTP) application. The databases are stored on a server named SQL1 that has SQL Server 2014 installed.
You plan to deploy an additional server that has SQL Server 2014 installed.
You need to design a high-availability solution for the databases that meets the following requirements:
If SQL1 fails, the databases must be available.
Users must be able to run reports against a secondary copy of the databases.
What should you include in the design?
More than one answer choice may achieve the goal. Select the BEST answer.
A. AlwaysOn availability groups
B. Database mirroring
C. Log shipping
D. Failover Clustering
Answer: A
Q4. Which code segment should you use to define the ProductDetails column?
A. ProductDetails xml (DOCUMENT Production.ProductDetailsSchema) NULL
B. ProductDetails xml NULL
C. ProductDetails xml (CONTENT Production.ProductDetailsSchema) NULL
D. ProductDetails varchar(MAX) NULL
Answer: D
Q5. You have a SQL Server 2012 database that contains a table named Users. The Users table contains usernames and passwords.
You need to ensure that all new records have a password.
Which code segment should you use?
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: D
Q6. You have a SQL Server 2012 database named Database1. Database1 contains a table named OrderDetails.
For a given sales order, you need to retrieve the OrderID, Quantity, and LineTotal columns for all of the items in the OrderDetails table. The solution must ensure that the results can be joined to other tables.
Which code segment should you execute?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q7. You need to modify the stored procedure usp_LookupConcurrentUsers.
What should you do?
A. Use the summary table as an in-memory optimized table with a non-hash clustered index.
B. Use the summary table as an in-memory optimized table with a non-hash nonclustered index.
C. Use a type variable instead of the summary table.
D. Add a clustered index to the summary table.
Answer: A
Q8. You have a database named DB1.
You plan to create a stored procedure that will insert rows into three different tables. Each insert must use the same identifying value for each table, but the value must increase from one invocation of the stored procedure to the next.
Occasionally, the identifying value must be reset to its initial value.
You need to design a mechanism to hold the identifying values for the stored procedure to use.
What should you do?
More than one answer choice may achieve the goal. Select the BEST answer.
A. Create a sequence object that holds the next value in the sequence. Retrieve the next value by using the stored procedure. Reset the value by using an ALTER SEQUENCE statement as needed.
B. Create a sequence object that holds the next value in the sequence. Retrieve the next value by using the stored procedure. Increment the sequence object to the next value by using an ALTER SEQUENCE statement. Reset the value as needed by using a different ALTER SEQUENCE statement.
C. Create a fourth table that holds the next value in the sequence. At the end each transaction, update the value by using the stored procedure. Reset the value as needed by using an UPDATE statement.
D. Create an identity column in each of the three tables. Use the same seed and the same increment for each table. Insert new rows into the tables by using the stored procedure. Use the DBCC CHECKIDENT command to reset the columns as needed.
Answer: A
Q9. You need to recommend a solution for the error handling of USP_3. The solution must minimize the amount of custom code required.
What should you recommend?
A. Use the @@ERROR variable in the nested stored procedures.
B. Use a TRY CATCH block in the called stored procedures.
C. Use the @@ERROR variable in the called stored procedures.
D. Use the RAISERROR command in the nested stored procedures.
Answer: B
Q10. 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: D
Q11. You need to recommend a solution that addresses the security requirement.
What should you recommend?
A. Revoke user permissions on the tables. Create stored procedures that manipulate data. Grant the users the EXECUTE permission on the stored procedures.
B. Grant the users the SELECT permission on the tables. Create views that retrieve data from the tables. Grant the users the SELECT permission on the views.
C. Deny the users SELECT permission on the tables. Create views that retrieve data from the tables. Grant the users the SELECT permission on the views.
D. Deny the users the SELECT permission on the tables. Create stored procedures that manipulate data. Grant the users the EXECUTE permission on the stored procedures.
Answer: C
Q12. 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
Q13. You execute the following code:
You need to select the task that has an IsFinished value of true from the Project that has an Id value of 1.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Q14. You need to create the object used by the parameter of usp_InsertSessions.
Which statement should you use?
A. CREATE XML SCHEMA COLLECTION SessionDataTable
B. CREATE TYPE SessionDataTable AS Table
C. CREATE SCHEMA SessionDataTable
D. CREATE TABLE SessionDataTable
Answer: B
Q15. You have a SQL Server 2012 instance.
You plan to create an application that uses spatial data.
You need to create an object that will support the representation of the surface area of all the oceans.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Q16. You need to write code that will allow the sales force to retrieve data for their reports with the least amount of effort.
Which code should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A