Q1. Your network contains a server named SQL1 that has SQL Server 2012 installed. SQL1 contains a database name DB1 and a table named Customers.
You add an additional server named SQL2 that runs SQL Server 2012.
You need to create a distributed partitioned view. The solution must minimize the amount of network traffic.
What should you do? (Each correct answer presents part of the solution. Choose all that apply.)
A. Add SQL2 as a Distributor.
B. Add the Customers table to SQL2.
C. Add SQL2 as a linked server.
D. Create the view on SQL1.
E. Remove the Customers table from SQL1.
F. Create the view on SQL2.
Answer: B,C,D,F
Q2. Topic 8)
You have a SQL Server 2012 database named database1.
Users report that queries that usually take less than one second to execute, take more than
30 seconds to execute.
You need to view the server resource consumption when the queries are executed.
What should you do?
To answer, move the appropriate actions from the list of actions to the answer area and
arrange them in the correct order.
Answer:
Q3. You need to implement a solution that meets the locking requirements. Which line of code should you modify?
A. Change line 07 in usp_UpdateOpening to: UPDATE Openings WITH (UPDLOCK)
B. Change line 09 in usp_GetOpenings to: FROM Openings o (ROWLOCK)
C. Change line 07 in usp_UpdateOpening to: UPDATE Openings WITH (READPAST)
D. Change line 09 in usp_GetOpenings to: FROM Openings o (NOLOCK)
Answer: D
Q4. You need to create a function that will use a SELECT statement in ProductsByProductType.sql.
Which code segment should you use to complete the function?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Explanation:
http://msdn.microsoft.com/en-us/library/ms191320.aspx http://msdn.microsoft.com/en-us/library/ms186755.aspx
Q5. Topic 7)
You need to create the usp.AssignUser stored procedure.
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:
Q6. Topic 8)
You have a table named Table1 that contains 1 million rows. Table1 contains a column named Column1 that stores sensitive information. Column1 uses the nvarchar(16) data type.
You have a certificate named Cert1.
You need to replace Column1 with a new encrypted column that uses two-way encryption.
Which code segment should you execute before you remove Column1?
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:
Q7. You attempt to process an invoice by using usp_InsertInvoice.sql and you receive the following error message: "Msg 515, Level 16, State 2, Procedure usp_InsertInvoice, Line 10
Cannot insert the value NULL into column 'InvoiceDate', table 'DB1.Accounting.Invoices' column does not allow nulls. INSERT fails."
You need to modify usp_InsertInvoice.sql to resolve the error.
How should you modify the INSERT statement?
A. InvoiceDate varchar(l00) 'InvoiceDate',
B. InvoiceDate varchar(100) 'Customer/InvoiceDate', '
C. InvoiceDate date '@InvoiceDate',
D. InvoiceDate date 'Customer/@InvoiceDate',
Answer: C
Topic 2, Scenario 2
Application Information
You have two servers named SQL1 and SQL2 that have SQL Server 2012 installed.
You have an application that is used to schedule and manage conferences.
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. A junior database administrator has created all the scripts that will be used to create the database. 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. (Line numbers are included for reference only.)
A database named DB2 resides on SQL2. DB2 has a table named SpeakerAudit that will audit changes to a table named Speakers.
A stored procedure named usp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executing usp_UpdateSpeakersName will always handle transactions.
A stored procedure named usp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName can read uncommitted data.
A stored procedure named usp_GetFutureSessions will be used to retrieve sessions that will occur in the future.
Procedures.sql
Indexes.sql Tables.sql
11. You are evaluating the index design.
You need to recommend a change to Indexes.sql that will minimize the amount of time it takes for usp_AttendeesReport to execute. The solution must minimize the amount of database fragmentation.
Which line of code should you use to replace line 12 of Indexes.sql?
A. (LastName);
B. (FirstName) INCLUDE (LastName);
C. (LastName, FirstName);
D. (LastName) INCLUDE (FirstName);
Q8. You need to provide referential integrity between the Offices table and Employees table.
Which code segment or segments should you add at line 27 of Tables.sql? (Each correct answer presents part of the solution. Choose all that apply.)
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C,D
Explanation:
http://msdn.microsoft.com/en-us/library/ms189049.aspx
Topic 4, Scenario 4
Application Information
You are a database administrator for a manufacturing company.
You have an application that stores product data. The data will be converted to technical diagrams for the manufacturing process.
The product details are stored in XML format. Each XML must contain only one product that has a root element named Product. A schema named Production.ProductSchema has been created for the products xml.
You develop a Microsoft .NET Framework assembly named ProcessProducts.dll that will be used to convert the XML files to diagrams. The diagrams will be stored in the database as images. ProcessProducts.dll contains one class named ProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source code file named ProcessProduct.cs.
All of the files are located in C:\Products\.
The application has several performance and security issues.
You will create a new database named ProductsDB on a new server that has SQL Server
2012 installed. ProductsDB will support the application.
The following graphic shows the planned tables for ProductsDB:
You will also add a sequence named Production.ProductID_Seq.
You plan to create two certificates named DBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB.
You have an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queries generated by the application appears in Dynamic.sql.
Application Requirements
The planned database has the following requirements: All stored procedures must be signed. The amount of disk space must be minimized. Administrative effort must be minimized at all times. The original product details must be stored in the database. An XML schema must be used to validate the product details. The assembly must be accessible by using T-SQL commands. A table-valued function will be created to search products by type. Backups must be protected by using the highest level of encryption. Dynamic T-SQL statements must be converted to stored procedures. Indexes must be optimized periodically based on their fragmentation. Manufacturing steps stored in the ManufacturingSteps table must refer to a product by the same identifier used by the Products table.
ProductDetails_Insert.sql
...........
Product, xml
All product types are 11 digits. The first five digits of the product id reference the category of the product and the remaining six digits are the subcategory of the product.
The following is a sample customer invoice in XML format:
ProductsByProductType.sql
Dynamic.sql
Category FromType.sql
IndexManagement.sql
30. An administrator provides a digital certificate named ServerCert.
You need to implement Transparent Data Encryption (TDE) on ProductsDB.
Which code segment should you use?
A. USE PRODUCTSDB; GO CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = TRIPLE_DES_3KEY ENCRYPTION BY SERVER CERTIFICATE DBCERT; GO ALTER DATABASE PRODUCTSDB SET ENCRYPTION ON; GO B. USE PRODUCTSDB; GO CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = TRIPLE_DES_3KEY ENCRYPTION BY SERVER CERTIFICATE PRODUCTSCERT; GO ALTER DATABASE PRODUCTSDB SET ENCRYPTION ON; GO
C. USE PRODUCTSDB; GO CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256 ENCRYPTION BY SERVER CERTIFICATE PRODUCTSCERT; GO ALTER DATABASE PRODUCTSDB SET ENCRYPTION ON; GO
D. USE PRODUCTSDB; GO CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256 ENCRYPTION BY SERVER CERTIFICATE DBCERT; GO ALTER DATABASE PRODUCTSDB SET ENCRYPTION ON; GO
Q9. You use SQL Azure to store data used by an e-commerce application.
You develop a stored procedure named sp1. Sp1 is used to read and change the price of all the products sold on the e-commerce site.
You need to ensure that other transactions are blocked from updating product data while sp1 is executing.
Which transaction isolation level should you use in sp1?
A. Repeatable read
B. Read committed
C. Serializable
D. Snapshot
Answer: C
Q10. Topic 8)
You plan to deploy two stored procedures name USP_1 and USP_2 that read data from a database.
Your company identifies the following requirements for each stored procedure:
. USP_1 cannot allow dirty reads.
. USP_2 must place range locks on the data to ensure read consistency.
You need to identify which isolation level you must set for each stored procedure. The solution must minimize the number of locks.
Which isolation level should you identify?
To answer, drag the appropriate isolation level to the correct stored procedure in the answer area. (Answer choices may be used once, more than once, or not at all.)
Answer: