70-459

Transition Your MCITP: Database Administrator 2008 or MCITP: Database Developer 2008 to MCSE: Data Platform


Note: The answer is for reference only, you need to understand all question.
QUESTION 1
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. Materialize the view.
B. Create an INSTEAD OF trigger on the view.
C. Define the view by using the CHECK option.
D. Define the view by using the SCHEMABINDING option.

Answer: B
Question 2
You create a view by using the following code:

Several months after you create the view, users report that the view has started to return unexpected results. You discover that the design of Table2 was modified since you created the view. You need to ensure that the view returns the correct results. Which code segment should you run?


A. Option A
B. Option B
C. Option C
D. Option D

Answer: A
Question 3
You plan to design an application that temporarily stores data in a SQL Azure database. You need to identify which types of database objects can be used to store data for the application. The solution must ensure that the application can make changes to the schema of a temporary object during a session. Which type of objects should you identify?
A. Common table expressions (CTEs)
B. Temporary tables
C. Table variables
D. Temporary stored procedures

Answer: B
Question 4
You are creating a table named Orders. You need to ensure that every time a new row is added to the Orders table, a user-defined function is called to validate the row before the row is added to the table. What should you use? More than one answer choice may achieve the goal. Select the BEST answer.
A. a Data Definition Language (DDL) trigger
B. a data manipulation language (DML) trigger
C. a DEFAULT constraint
D. a FOREIGN KEY constraint
E. a CHECK constraint

Answer: E
Question 5
You have an index for a table in a SQL Azure database. The database is used for Online Transaction Processing (OLTP). You discover that the index consumes more physical disk space than necessary. You need to minimize the amount of disk space that the index consumes. What should you set from the index options?

A. STATISTICS_NORECOMPUTE = OFF
B. STATISTICS_NORECOMPUTE = ON
C. FILLFACTOR = 0
D. FILLFACTOR = 80

Answer: C
Question 6
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. Productive varchar(11) 'ProductType/SID',
B. ProductType varchar(11) '@ProductType',
C. Productive varchar(11) 'ProductType/ID',
D. ProductType varchar(11) 'ProductType1,

Answer: D Question 7


You run the following code:

You need to ensure that the root node of the XML data stored in the Details column is . What should you implement? More than one answer choice may achieve the goal. Select the BEST answer.
A. A user-defined data type
B. A Data Definition Language (DDL) trigger
C. A data manipulation language (DML) trigger
D. An XML schema collection
E. An XML index

Answer: D
Question 8
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. Grant User1 the INSERT permission on Table2.
B. Add User1 to the db_datawriter role.
C. Grant User1 the EXECUTE permission on sp1.
D. Change sp1 to run as the sa user.

Answer: D
Question 9
DRAG DROP You are designing an authentication strategy for a new server that has SQL Server 2012 installed. The strategy

must meet the following business requirements: �� The account used to generate reports must be allowed to make a connection during certain hours only. �� Failed authentication requests must be logged. You need to recommend a technology that meets each business requirement. The solution must minimize the amount of events that are logged. Which technologies should you recommend? To answer, drag the appropriate solution to the correct business requirement in the answer area.

Answer:

QUESTION 10
You are creating a database that will store usernames and passwords for an application. You need to recommend a solution to store the passwords in the database. What should you recommend? More than one answer choice may achieve the goal. Select the BEST answer.
A. Encrypting File System (EFS)
B. One-way encryption

C. Reversible encryption
D. Transparent Data Encryption (TDE)

Answer: B
Question 11
DRAG DROP You have a SQL Azure database named Database1. You need to design the schema for a table named table1. Table1 will have less than one million rows. Table1 will contain the following information for each row:

The solution must minimize the amount of space used to store each row. Which data types should you recommend for each column? To answer, drag the appropriate data type to the correct column in the answer area.


Answer:

QUESTION 12
You are designing a SQL Server database for an order fulfillment system. You create a table named Sales.Orders by using the following script:

Each order is tracked by using one of the following statuses: �� Fulfilled �� Shipped �� Ordered �� Received You need to design the database to ensure that you can retrieve the status of an order on a given date. The solution must ensure that new statuses can be added in the future. What should you do? More than one answer choice may achieve the goal. Select the BEST answer.
A. To the Sales.Orders table, add a column named Status that will store the order status. Update

the Status column as the order status changes.
B. To the Sales.Orders table, add three columns named FulfilledDate, ShippedDate, and ReceivedDate. Update the value of each column from null to the appropriate date as the order status changes.
C. Implement change data capture on the Sales.Orders table.
D. Create a new table named Sales.OrderStatus that contains three columns named OrderID, StatusDate, and Status. Insert new rows into the table as the order status changes.

Answer: D
Question 13
DRAG DROP You plan to deploy SQL Server 2012. Your company identifies the following monitoring requirements for the database: �� An e-mail message must be sent if the SQL Server Authentication mode changes. �� An e-mail message must be sent if CPU utilization exceeds 90 percent. You need to identify which feature meets each monitoring requirement. Which features should you identify? To answer, drag the appropriate feature to the correct monitoring requirement in the answer area.

Answer:


Question 14
You are troubleshooting an application that runs a query. The application frequently causes deadlocks. You need to identify which transaction causes the deadlock. What should you do? More than one answer choice may achieve the goal. Select the BEST answer.
A. Query the sys.dm_exec_sessions dynamic management view.
B. Create an extended events session to capture deadlock information.
C. Query the sys.dm_exec_requests dynamic management view.
D. Create a trace in SQL Server Profiler that contains the Deadlock graph event.

Answer: C
Question 15
DRAG DROP You plan to deploy SQL Server 2012. You must create two tables named Table 1 and Table 2 that will have the following specifications: �� Table1 will contain a date column named Column1 that will contain a null value approximately 80 percent of the time. �� Table2 will contain a column named Column2 that is the product of two other columns in Table2. Both Table1 and Table2 will contain more than 1 million rows. You need to recommend which options must be defined for the columns. The solution must minimize the storage requirements for the tables. Which options should you recommend? To answer, drag the appropriate options to the correct column in the answer area.


Answer:

QUESTION 16
DRAG DROP
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 by using UNC paths. �� StudentGrades must be backed up on a separate schedule than the rest of the 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:

QUESTION 17
You plan to create a database. The database will be used by a Microsoft .NET application for a special event that will last for two days. During the event, data must be highly available. After the event, the database will be deleted. You need to recommend a solution to implement the database while minimizing costs. The solution must not affect any existing applications. What should you recommend? More than one answer choice may achieve the goal. Select the BEST answer.
A. SQL Server 2012 Enterprise
B. SQL Azure
C. SQL Server 2012 Express with Advanced Services
D. SQL Server 2012 Standard
Answer: B Question 18

You have a server named Server1 that has 16 processors. You plan to deploy multiple instances of SQL Server 2012 to Server1. You need to recommend a method to allocate processors to each instance. What should you include in the recommendation? More than one answer choice may achieve the goal. Select the BEST answer.
A. Max Degree of Parallelism
B. Processor affinity
C. Windows System Resource Manager (WSRM)
D. Resource Governor

Answer: B
Question 19
You have a SQL Azure database. You need to identify which keyword must be used to create a view that will be indexed. Which keyword should you identify?
A. DISTINCT
B. DEFAULT
C. SCHEMABINDING
D. VIEW_METADATA

Answer: C
Question 20
DRAG DROP You are designing two stored procedures named Procedure1 and Procedure2. You identify the following requirements: �� Procedure1 must take a parameter that ensures that multiple rows of data can pass into the stored procedure. �� Procedure2 must use business logic that resides in a Microsoft .NET Framework assembly. You need to identify the appropriate technology for each stored procedure. Which technologies should you identify? To answer, drag the appropriate technology to the correct stored procedure in the answer area. (Answer choices may be used once, more than once, or not at all.)


Answer:

QUESTION 21
You have a database hosted on SQL Azure. You are developing a script to create a view that will be used to update the data in a table. The following is the relevant portion of the script. (Line numbers are included for reference only.)

You need to ensure that the view can update the data in the table, except for the data in Columnl. Which code segment should you add at line 06?
A. WITH VIEW_METADATA
B. WITH ENCRYPTION
C. WITH CHECK OPTION
D. WITH SCHEMABINDING

Answer: C Question 22

You have a text file that contains an XML Schema Definition (XSD). You have a table named Schema1.Table1. You have a stored procedure named Schema1.Proc1 that accepts an XML parameter named Param1. You need to store validated XML data in Schema1.Table1. The solution must ensure that only valid XML data is accepted by Param1. What should you do? (Each correct answer presents part of the solution. Choose all that apply.)
A. Use the modify method to insert the XML schema into each row of the XML column in Table1.
B. Define an XML column in Table1 by using an XML schema collection.
C. Declare Param1 var1 as type XML and associate the variable to the XML schema collection.
D. Create an XML schema collection in the database from the text file.

Answer: ABD
Question 23
You have an index for a table in a SQL Azure database. The database is used for Online Transaction Processing (OLTP). You discover that many page splits occur when records are inserted or updated in the table. You need to minimize the number of page splits. What should you set from the index options?
A. FILLFACTOR = 0
B. STATISTICS_NORECOMPUTE = ON
C. STATISTICS_NORECOMPUTE = OFF
D. FILLFACTOR = 80
Answer: D
Question 24
You have a SQL Azure database. You execute the following script:

You add 1 million rows to Table1. Approximately 85 percent of all the rows have a null value for Column2. You plan to deploy an application that will search Column2. You need to create an index on Table1 to support the planned deployment. The solution must minimize the storage requirements. Which code segment should you execute?

A. CREATE INDEX IX_Table1 ON Table1 (Column1) INCLUDE (Column2)
B. CREATE INDEX IX_Table1 ON Table1 (Coiumn2) WHERE Column2 IS NOT NULL
C. CREATE INDEX IX_Table1 ON Table1 (Column2) WHERE Column2 IS NULL
D. CREATE INDEX IX_Table1 ON Table1 (Column2) WITH FILLFACTOR=0

Answer: B
Question 25
You are creating a table named Orders. You need to ensure that every time a new row is added to the Orders table, a table that is used for auditing is updated. What should you use? More than one answer choice may achieve the goal. Select the BEST answer.
A. a DEFAULT constraint
B. a Data Definition Language (DDL) trigger
C. a CHECK constraint
D. a FOREIGN KEY constraint
E. a data manipulation language (DML) trigger

Answer: E
Question 26
DRAG DROP You execute the following code: CREATE TA3LS Customers ( id int primary key, name nchar(10) ) GO You discover that the Customers table was created in the dbo schema. You need to create a code segment to move the table to another schema named Schema2. What should you create? To answer, drag the appropriate code segments to the correct location in the answer area. (Answer choices may be used once, more than once, or not at all.)


Answer:

QUESTION 27
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. a SQL Server Profiler template
B. an Extended Events session
C. log errors by using trace flag 1204
D. log errors by using trace flag 1222

Answer: B
Question 28
You execute the following code.

You need to reduce the amount of time it takes to execute the query. What should you do?
A. Change SUBSTRING(JobTitle,1, 1) = `c' to JobTitle LIKE `c%1'.
B. Partition the table and use the JobTitle column for the partition scheme.
C. Replace IX_Employees with a clustered index.
D. Change SUBSTRING (JobTitle, 1, 1) = V to LEFT(JobTitle ,1) = 'c'.

Answer: A
Question 29
You have a SQL Server 2012 database named DB1. You have a backup device named Device1. You discover that the log file for the database is full. You need to ensure that DB1 can complete transactions. The solution must not affect the chain of log sequence numbers (LSNs). Which code segment should you execute?

A. BACXUP LOG DB1 TO Device1 WITH TRUNCATE_ONLY
B. BACKUP LOG DB1 TO Device1 WITH COPY_ONLY
C. BACKUP LCG DB1 TO Device1 WITH NORECOVERY
D. BACKUP LOG DB1 TC Device1

Answer: D
Question 30
You have a server that has SQL Server 2012 installed. You need to identify which parallel execution plans are running in serial. Which tool should you use?
A. Performance Monitor
B. Database Engine Tuning Advisor
C. Extended Events
D. Data Profile Viewer

Answer: C
Question 31
DRAG DROP 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:


QUESTION 32
You are creating a table to support an application that will cache data outside of SQL Server. The application will detect whether cached values were changed before it updates the values. You need to create the table, and then verify that you can insert a row into the table. Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D

Answer: D
Question 33
You use SQL Server 2012 to maintain the data used by the applications at your company. You plan to create a table named Table1 by using the following statement. (Line numbers are included for reference only.)


You need to ensure that Table1 contains a column named UserName. The UserName column will: �� Store string values in any language. �� Accept a maximum of 200 characters. �� Be case-sensitive and accent-sensitive. Which code segment should you add at line 03?
A. UserName nvarchar(200) COLLATE Latin1_General_CI_AI NOT NULL,
B. UserName varchar(200) COLLATE Latin1_GeneraI_CI_AI NOT NULL,
C. UserName nvarchar(200) COLLATE Latin1_General_CS_ASNOT NULL,
D. UserName nvarchar(200) COLLATE Latin1_General_CS_ASNOT NULL,

Answer: C
Question 34
DRAG DROP You plan to deploy SQL Server 2012. Your company identifies the following monitoring requirements: �� Tempdb must be monitored for insufficient free space. �� Deadlocks must be analyzed by using Deadlock graphs. You need to identify which feature meets each monitoring requirement. Which features should you identify? To answer, drag the appropriate feature to the correct monitoring requirement in the answer area.


Answer:

QUESTION 35
You are creating a database that will store usernames and credit card numbers for an application. You need to recommend a solution to store the credit card numbers in the database. What should you recommend? More than one answer choice may achieve the goal. Select the BEST answer.
A. One-way encryption
B. Reversible encryption
C. Encrypting File System (EPS)
D. Transparent Data Encryption (TDE)
Answer: B Question 36

DRAG DROP You plan to deploy SQL Server 2012. You identify the following security requirements for the deployment: �� Users must be prevented from intercepting and reading the T-SQL statements sent from the clients to the database engine. �� All database files and log files must be encrypted if the files are moved to another disk on another server. You need to identify which feature meets each security requirement. The solution must minimize processor overhead. Which features should you identify? To answer, drag the appropriate feature to the correct requirement in the answer area.

Answer:

QUESTION 37

DRAG DROP
You plan to install two SQL Server 2012 environments named Environmentl and Environment2. Your company identifies the following availability requirements for each environment: �� Environment1 must have mirroring with automatic failover implemented. �� Environment2 must have AlwaysOn with automatic failover implemented. You need to identify the minimum number of SQL Server 2012 servers that must be deployed to each environment to ensure that all data remains available if a physical server fails. How many servers should you identify? To answer, drag the appropriate number to the correct environment in the answer area.

Answer:

QUESTION 38
You have two SQL Server instances named SQLDev and SQLProd that have access to various storage media. You plan to synchronize SQLDev and SQLProd. You need to recommend a solution that meets the following requirements: �� The database schemas must be synchronized from SQLDev to SQLProd. �� The database on SQLDev must be deployed to SQLProd by using a package. �� The package must support being deployed to SQL Azure. What should you recommend? More than one answer choice may achieve the goal. Select the BEST answer.
A. a database snapshot
B. change data capture
C. a data-tier application
D. SQL Server Integration Services (SSIS)


Answer: C
Question 39
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 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.
C. 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.
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
Question 40 Case Study 1: A Datum Overview General Overview
A. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forest named adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datum standardizes its database platform by using SQL Server 2012 Standard edition.

Databases
Each office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Servers and databases are managed by a team of database administrators. Currently, all of the database administrators have the same level of permissions on all of the servers and all of the databases. The Customers database contains two tables named Customers and Classifications. The following graphic shows the relevant portions of the tables:


The following table shows the current data in the Classifications table:

The Inventory database is used mainly for reports. The database is recreated every day. A full backup of the database currently takes three hours to complete. Stored Procedures A stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data from five different tables from the Sales and Customers databases in a table named Table1. After Table1 is created, the reporting process reads data from a table in the Products database and searches for information in Table1 based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedure named sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables the procedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of several UPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statements fails, the stored procedure continues to execute.
A stored procedure named sp4 calls stored procedures in the Sales, Customers, and Inventory databases. The nested stored procedures read tables from the Sales, Customers, and Inventory databases. Sp4 uses an EXECUTE AS clause. A stored procedure named sp5 changes data in multiple databases. Security checks are performed each time sp5 accesses a database. You suspect that the security checks are slowing down the performance of sp5. All stored procedures accessed by user applications call nested stored procedures. The nested stored procedures are never called directly.

Design Requirements Data Recovery
You must be able to recover data from the Inventory database if a storage failure occurs. You have a Recovery Point Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lost accidentally. You have a Recovery Point Objective (RPO) of one day.


Classification Changes
You plan to change the way customers are classified. The new classifications will have four levels based on the number of orders. Classifications may be removed or added in the future. Management requests that historical data be maintained for the previous classifications.

Security
A group of junior database administrators must be able to view the server state of the SQL Server instance that hosts the Sales database. The junior database administrators will not have any other administrative rights.

Question
You need to recommend a solution for the planned changes to the customer classifications. What should you recommend? (Each correct answer presents part of the solution. Choose all that apply.)
A. Add a table to track any changes made to the classification of each customer.
B. Add columns for each classification to the Customers table.
C. Implement change data capture.
D. Add a row to the Customers table each time a classification changes.
E. Add a column to the Classifications table to track the status of each classification.

Answer: AC
Question 41 Case Study 1: A Datum Overview General Overview
A. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forest named adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datum standardizes its database platform by using SQL Server 2012 Standard edition.

Databases
Each office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Servers and databases are managed by a team of database administrators. Currently, all of the database administrators have the same level of permissions on all of the servers and all of the databases. The Customers database contains two tables named Customers and Classifications. The following graphic shows the relevant portions of the tables:


The following table shows the current data in the Classifications table:

The Inventory database is used mainly for reports. The database is recreated every day. A full backup of the database currently takes three hours to complete. Stored Procedures A stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data from five different tables from the Sales and Customers databases in a table named Table1. After Table1 is created, the reporting process reads data from a table in the Products database and searches for information in Table1 based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedure named sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables the procedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of several UPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statements fails, the stored procedure continues to execute.
A stored procedure named sp4 calls stored procedures in the Sales, Customers, and Inventory databases. The nested stored procedures read tables from the Sales, Customers, and Inventory databases. Sp4 uses an EXECUTE AS clause. A stored procedure named sp5 changes data in multiple databases. Security checks are performed each time sp5 accesses a database. You suspect that the security checks are slowing down the performance of sp5. All stored procedures accessed by user applications call nested stored procedures. The nested stored procedures are never called directly.

Design Requirements Data Recovery
You must be able to recover data from the Inventory database if a storage failure occurs. You have a Recovery Point Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lost accidentally. You have a Recovery Point

Objective (RPO) of one day.

Classification Changes
You plan to change the way customers are classified. The new classifications will have four levels based on the number of orders. Classifications may be removed or added in the future. Management requests that historical data be maintained for the previous classifications.

Security
A group of junior database administrators must be able to view the server state of the SQL Server instance that hosts the Sales database. The junior database administrators will not have any other administrative rights.

Question
You need to recommend a change to sp3 to ensure that the procedure completes only if all of the UPDATE statements complete. Which change should you recommend?
A. Set the IMPLICIT_TRANSACTIONS option to off.
B. Set the XACT_ABORT option to off
C. Set the IMPLICIT_TRANSACTIONS option to on.
D. Set the XACT_ABORT option to on.

Answer: D
Question 42 Case Study 1: A Datum Overview General Overview
A. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forest named adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datum standardizes its database platform by using SQL Server 2012 Standard edition.

Databases
Each office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Servers and databases are managed by a team of database administrators. Currently, all of the database administrators have the same level of permissions on all of the servers and all of the databases. The Customers database contains two tables named Customers and Classifications. The following graphic shows the relevant portions of the tables:


The following table shows the current data in the Classifications table:

The Inventory database is used mainly for reports. The database is recreated every day. A full backup of the database currently takes three hours to complete. Stored Procedures A stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data from five different tables from the Sales and Customers databases in a table named Table1. After Table1 is created, the reporting process reads data from a table in the Products database and searches for information in Table1 based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedure named sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables the procedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of several UPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statements fails, the stored procedure continues to execute.
A stored procedure named sp4 calls stored procedures in the Sales, Customers, and Inventory databases. The nested stored procedures read tables from the Sales, Customers, and Inventory databases. Sp4 uses an EXECUTE AS clause. A stored procedure named sp5 changes data in multiple databases. Security checks are performed each time sp5 accesses a database. You suspect that the security checks are slowing down the performance of sp5. All stored procedures accessed by user applications call nested stored procedures. The nested stored procedures are never called directly.

Design Requirements Data Recovery
You must be able to recover data from the Inventory database if a storage failure occurs. You have a Recovery Point Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lost accidentally. You have a Recovery Point

Objective (RPO) of one day.

Classification Changes
You plan to change the way customers are classified. The new classifications will have four levels based on the number of orders. Classifications may be removed or added in the future. Management requests that historical data be maintained for the previous classifications.

Security
A group of junior database administrators must be able to view the server state of the SQL Server instance that hosts the Sales database. The junior database administrators will not have any other administrative rights.

Question
You need to recommend a solution to meet the security requirements of the junior database administrators. What should you include in the recommendation?
A. a shared login
B. a database role
C. a credential
D. a server role

Answer: D
Question 43 Case Study 1: A Datum Overview General Overview
A. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forest named adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datum standardizes its database platform by using SQL Server 2012 Standard edition.

Databases
Each office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Servers and databases are managed by a team of database administrators. Currently, all of the database administrators have the same level of permissions on all of the servers and all of the databases. The Customers database contains two tables named Customers and Classifications. The following graphic shows the relevant portions of the tables:


The following table shows the current data in the Classifications table:

The Inventory database is used mainly for reports. The database is recreated every day. A full backup of the database currently takes three hours to complete. Stored Procedures A stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data from five different tables from the Sales and Customers databases in a table named Table1. After Table1 is created, the reporting process reads data from a table in the Products database and searches for information in Table1 based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedure named sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables the procedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of several UPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statements fails, the stored procedure continues to execute.
A stored procedure named sp4 calls stored procedures in the Sales, Customers, and Inventory databases. The nested stored procedures read tables from the Sales, Customers, and Inventory databases. Sp4 uses an EXECUTE AS clause. A stored procedure named sp5 changes data in multiple databases. Security checks are performed each time sp5 accesses a database. You suspect that the security checks are slowing down the performance of sp5. All stored procedures accessed by user applications call nested stored procedures. The nested stored procedures are never called directly.

Design Requirements Data Recovery
You must be able to recover data from the Inventory database if a storage failure occurs. You have a Recovery Point Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lost accidentally. You have a Recovery Point Objective (RPO) of one day.


Classification Changes
You plan to change the way customers are classified. The new classifications will have four levels based on the number of orders. Classifications may be removed or added in the future. Management requests that historical data be maintained for the previous classifications.

Security
A group of junior database administrators must be able to view the server state of the SQL Server instance that hosts the Sales database. The junior database administrators will not have any other administrative rights.

Question
You need to recommend a solution to minimize the amount of time it takes to execute sp1. With what should you recommend replacing Table1?
A. a temporary table
B. a function
C. a view
D. a table variable

Answer: C
Question 44 Case Study 1: A Datum Overview General Overview
A. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forest named adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datum standardizes its database platform by using SQL Server 2012 Standard edition.

Databases
Each office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Servers and databases are managed by a team of database administrators. Currently, all of the database administrators have the same level of permissions on all of the servers and all of the databases. The Customers database contains two tables named Customers and Classifications. The following graphic shows the relevant portions of the tables:


The following table shows the current data in the Classifications table:

The Inventory database is used mainly for reports. The database is recreated every day. A full backup of the database currently takes three hours to complete. Stored Procedures A stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data from five different tables from the Sales and Customers databases in a table named Table1. After Table1 is created, the reporting process reads data from a table in the Products database and searches for information in Table1 based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedure named sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables the procedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of several UPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statements fails, the stored procedure continues to execute.
A stored procedure named sp4 calls stored procedures in the Sales, Customers, and Inventory databases. The nested stored procedures read tables from the Sales, Customers, and Inventory databases. Sp4 uses an EXECUTE AS clause. A stored procedure named sp5 changes data in multiple databases. Security checks are performed each time sp5 accesses a database. You suspect that the security checks are slowing down the performance of sp5. All stored procedures accessed by user applications call nested stored procedures. The nested stored procedures are never called directly.

Design Requirements Data Recovery
You must be able to recover data from the Inventory database if a storage failure occurs. You have a Recovery Point Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lost accidentally. You have a Recovery Point

Objective (RPO) of one day.

Classification Changes
You plan to change the way customers are classified. The new classifications will have four levels based on the number of orders. Classifications may be removed or added in the future. Management requests that historical data be maintained for the previous classifications.

Security
A group of junior database administrators must be able to view the server state of the SQL Server instance that hosts the Sales database. The junior database administrators will not have any other administrative rights.

Question
You need to recommend a disaster recovery strategy for the Inventory database. What should you include in the recommendation?
A. Log shipping
B. Always on availability groups
C. SQL Server Failover Clustering
D. Peer-to-peer replication

Answer: A
Question 45 Case Study 1: A Datum Overview General Overview
A. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forest named adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datum standardizes its database platform by using SQL Server 2012 Standard edition.

Databases
Each office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Servers and databases are managed by a team of database administrators. Currently, all of the database administrators have the same level of permissions on all of the servers and all of the databases. The Customers database contains two tables named Customers and Classifications. The following graphic shows the relevant portions of the tables:


The following table shows the current data in the Classifications table:

The Inventory database is used mainly for reports. The database is recreated every day. A full backup of the database currently takes three hours to complete. Stored Procedures A stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data from five different tables from the Sales and Customers databases in a table named Table1. After Table1 is created, the reporting process reads data from a table in the Products database and searches for information in Table1 based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedure named sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables the procedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of several UPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statements fails, the stored procedure continues to execute.
A stored procedure named sp4 calls stored procedures in the Sales, Customers, and Inventory databases. The nested stored procedures read tables from the Sales, Customers, and Inventory databases. Sp4 uses an EXECUTE AS clause. A stored procedure named sp5 changes data in multiple databases. Security checks are performed each time sp5 accesses a database. You suspect that the security checks are slowing down the performance of sp5. All stored procedures accessed by user applications call nested stored procedures. The nested stored procedures are never called directly.

Design Requirements Data Recovery
You must be able to recover data from the Inventory database if a storage failure occurs. You have a Recovery Point Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lost accidentally. You have a Recovery Point Objective (RPO) of one day.


Classification Changes
You plan to change the way customers are classified. The new classifications will have four levels based on the number of orders. Classifications may be removed or added in the future. Management requests that historical data be maintained for the previous classifications.

Security
A group of junior database administrators must be able to view the server state of the SQL Server instance that hosts the Sales database. The junior database administrators will not have any other administrative rights.

Question
You need to recommend a solution to ensure that sp4 adheres to the security requirements. What should you include in the recommendation?
A. Configure data manipulation language(DML) triggers.
B. Enable SQL Server Audit.
C. Enable trace flags.
D. Enable C2 audit tracing.

Answer: B
Question 46 Case Study 1: A Datum Overview General Overview
A. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forest named adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datum standardizes its database platform by using SQL Server 2012 Standard edition.

Databases
Each office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Servers and databases are managed by a team of database administrators. Currently, all of the database administrators have the same level of permissions on all of the servers and all of the databases. The Customers database contains two tables named Customers and Classifications. The following graphic shows the relevant portions of the tables:


The following table shows the current data in the Classifications table:

The Inventory database is used mainly for reports. The database is recreated every day. A full backup of the database currently takes three hours to complete. Stored Procedures A stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data from five different tables from the Sales and Customers databases in a table named Table1. After Table1 is created, the reporting process reads data from a table in the Products database and searches for information in Table1 based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedure named sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables the procedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of several UPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statements fails, the stored procedure continues to execute.
A stored procedure named sp4 calls stored procedures in the Sales, Customers, and Inventory databases. The nested stored procedures read tables from the Sales, Customers, and Inventory databases. Sp4 uses an EXECUTE AS clause. A stored procedure named sp5 changes data in multiple databases. Security checks are performed each time sp5 accesses a database. You suspect that the security checks are slowing down the performance of sp5. All stored procedures accessed by user applications call nested stored procedures. The nested stored procedures are never called directly.

Design Requirements Data Recovery
You must be able to recover data from the Inventory database if a storage failure occurs. You have a Recovery Point Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lost accidentally. You have a Recovery Point

Objective (RPO) of one day.

Classification Changes
You plan to change the way customers are classified. The new classifications will have four levels based on the number of orders. Classifications may be removed or added in the future. Management requests that historical data be maintained for the previous classifications.

Security
A group of junior database administrators must be able to view the server state of the SQL Server instance that hosts the Sales database. The junior database administrators will not have any other administrative rights.

Question
You need to recommend a change to sp3 to ensure that the procedure continues to execute even if one of the UPDATE statements fails. Which change should you recommend?
A. Set the IMPLICIT_TRANSACTIONS option to on.
B. Set the XACT_ABORT option to off.
C. Set the IMPLICIT_TRANSACTIONS option to off.
D. Set the XACT_ABORT option to on.

Answer: B
Question 47 Case Study 2: Contoso Ltd Overview Application Overview
Contoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing a new version of the ERP application. The previous version of the ERP application used SQL Server 2008 R2. The new version will use SQL Server 2012. The ERP application relies on an import process to load supplier data. The import process updates thousands of rows simultaneously, requires exclusive access to the database, and runs daily. You receive several support calls reporting unexpected behavior in the ERP application. After analyzing the calls, you conclude that users made changes directly to the tables in the database.

Tables
The current database schema contains a table named OrderDetails. The OrderDetails table contains information about the items sold for each purchase order. OrderDetails stores the product ID, quantities, and discounts applied to each product in a purchase order. The product price is stored in a table named Products.
The Products table was defined by using the SQL_Latinl_General_CP1_CI_AS collation. A column named ProductName was created by using the varchar data type. The database contains a table named Orders. Orders contains alt of the purchase orders from the last 12 months. Purchase orders that are older than 12

months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

Stored Procedures
The current version of the database contains stored procedures that change two tables. The following shows the relevant portions of the two stored procedures:


Customer Problems Installation Issues
The current version of the ERP application requires that several SQL Server logins be set up to function correctly. Most customers set up the ERP application in multiple locations and must create logins multiple times.

Index Fragmentation Issues
Customers discover that clustered indexes often are fragmented. To resolve this issue, the customers defragment the indexes more frequently. All of the tables affected by fragmentation have the following columns that are used as the clustered index key:


Backup Issues
Customers who have large amounts of historical purchase order data report that backup time is unacceptable.

Search Issues

Users report that when they search product names, the search results exclude product names that contain
accents, unless the search string includes the accent.

Missing Data Issues
Customers report that when they make a price change in the Products table, they cannot retrieve the price that the item was sold for in previous orders.

Query Performance Issues
Customers report that query performance degrades very quickly. Additionally, the customers report that users cannot run queries when SQL Server runs maintenance tasks.

Import Issues
During the monthly import process, database administrators receive many supports call from users who report that they cannot access the supplier data. The database administrators want to reduce the amount of time required to import the data.

Design Requirements File Storage Requirements
The ERP database stores scanned documents that are larger than 2 MB. These files must only be accessed through the ERP application. File access must have the best possible read and write performance.

Data Recovery Requirements
If the import process fails, the database must be returned to its prior state immediately.

Security Requirements
You must provide users with the ability to execute functions within the ERP application, without having direct access to the underlying tables.

Concurrency Requirements
You must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.

Question
You need to recommend a solution that addresses the concurrency requirement. What should you recommend?
A. Make calls to Sales.Proc1 and Sales.Proc2 synchronously.
B. Modify the stored procedures to update tables in the same order for all of the stored procedures.
C. Call the stored procedures in a Distributed Transaction Coordinator (DTC) transaction.
D. Break each stored procedure into two separate procedures, one that changes Sales.Table1 and one that changes Sales.Table2.
Answer: B QUESTION 48 Case Study 2: Contoso Ltd Overview Application Overview

Contoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing a new version of the ERP application. The previous version of the ERP application used SQL Server 2008 R2. The new version will use SQL Server 2012. The ERP application relies on an import process to load supplier data. The import process updates thousands of rows simultaneously, requires exclusive access to the database, and runs daily. You receive several support calls reporting unexpected behavior in the ERP application. After analyzing the calls, you conclude that users made changes directly to the tables in the database.

Tables
The current database schema contains a table named OrderDetails. The OrderDetails table contains information about the items sold for each purchase order. OrderDetails stores the product ID, quantities, and discounts applied to each product in a purchase order. The product price is stored in a table named Products.
The Products table was defined by using the SQL_Latinl_General_CP1_CI_AS collation. A column named ProductName was created by using the varchar data type. The database contains a table named Orders. Orders contains alt of the purchase orders from the last 12 months. Purchase orders that are older than 12 months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

Stored Procedures
The current version of the database contains stored procedures that change two tables. The following shows the relevant portions of the two stored procedures:



Customer Problems Installation Issues
The current version of the ERP application requires that several SQL Server logins be set up to function correctly. Most customers set up the ERP application in multiple locations and must create logins multiple times.

Index Fragmentation Issues
Customers discover that clustered indexes often are fragmented. To resolve this issue, the customers defragment the indexes more frequently. All of the tables affected by fragmentation have the following columns that are used as the clustered index key:


Backup Issues
Customers who have large amounts of historical purchase order data report that backup time is unacceptable.

Search Issues
Users report that when they search product names, the search results exclude product names that contain accents, unless the search string includes the accent.

Missing Data Issues
Customers report that when they make a price change in the Products table, they cannot retrieve the price that the item was sold for in previous orders.

Query Performance Issues
Customers report that query performance degrades very quickly. Additionally, the customers report that users cannot run queries when SQL Server runs maintenance tasks.

Import Issues
During the monthly import process, database administrators receive many supports call from users who report that they cannot access the supplier data. The database administrators want to reduce the amount of time required to import the data.

Design Requirements File Storage Requirements
The ERP database stores scanned documents that are larger than 2 MB. These files must only be accessed through the ERP application. File access must have the best possible read and write performance.
Data Recovery Requirements

If the import process fails, the database must be returned to its prior state immediately.

Security Requirements
You must provide users with the ability to execute functions within the ERP application, without having direct access to the underlying tables.

Concurrency Requirements
You must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.

Question
You need to recommend a solution that addresses the backup issue. The solution must minimize the amount of development effort. What should you include in the recommendation?
A. filegroups
B. indexed views
C. table partitioning
D. indexes

Answer: A
Question 49 Case Study 2: Contoso Ltd Overview Application Overview
Contoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing a new version of the ERP application. The previous version of the ERP application used SQL Server 2008 R2. The new version will use SQL Server 2012. The ERP application relies on an import process to load supplier data. The import process updates thousands of rows simultaneously, requires exclusive access to the database, and runs daily. You receive several support calls reporting unexpected behavior in the ERP application. After analyzing the calls, you conclude that users made changes directly to the tables in the database.

Tables
The current database schema contains a table named OrderDetails. The OrderDetails table contains information about the items sold for each purchase order. OrderDetails stores the product ID, quantities, and discounts applied to each product in a purchase order. The product price is stored in a table named Products.
The Products table was defined by using the SQL_Latinl_General_CP1_CI_AS collation. A column named ProductName was created by using the varchar data type. The database contains a table named Orders. Orders contains alt of the purchase orders from the last 12 months. Purchase orders that are older than 12 months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.


Stored Procedures
The current version of the database contains stored procedures that change two tables. The following shows the relevant portions of the two stored procedures:


Customer Problems Installation Issues
The current version of the ERP application requires that several SQL Server logins be set up to function correctly. Most customers set up the ERP application in multiple locations and must create logins multiple times.

Index Fragmentation Issues
Customers discover that clustered indexes often are fragmented. To resolve this issue, the customers defragment the indexes more frequently. All of the tables affected by fragmentation have the following columns that are used as the clustered index key:


Backup Issues
Customers who have large amounts of historical purchase order data report that backup time is unacceptable.

Search Issues
Users report that when they search product names, the search results exclude product names that contain accents, unless the search string includes the accent.


Missing Data Issues
Customers report that when they make a price change in the Products table, they cannot retrieve the price that the item was sold for in previous orders.

Query Performance Issues
Customers report that query performance degrades very quickly. Additionally, the customers report that users cannot run queries when SQL Server runs maintenance tasks.

Import Issues
During the monthly import process, database administrators receive many supports call from users who report that they cannot access the supplier data. The database administrators want to reduce the amount of time required to import the data.

Design Requirements File Storage Requirements
The ERP database stores scanned documents that are larger than 2 MB. These files must only be accessed through the ERP application. File access must have the best possible read and write performance.

Data Recovery Requirements
If the import process fails, the database must be returned to its prior state immediately.

Security Requirements
You must provide users with the ability to execute functions within the ERP application, without having direct access to the underlying tables.
Concurrency Requirements
You must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.

Question
You need to recommend a solution that addresses the index fragmentation and index width issue. What should you include in the recommendation? (Each correct answer presents part of the solution. Choose all that apply.)
A. Change the data type of the lastModified column to smalldatetime.
B. Remove the modifiedBy column from the clustered index.
C. Change the data type of the id column to bigint.
D. Remove the lastModified column from the clustered index.
E. Change the data type of the modifiedBy column to tinyint.
F. Remove the id column from the clustered index.
Answer: ABF Question 50 Case Study 2: Contoso Ltd Overview Application Overview

Contoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing a new version of the ERP application. The previous version of the ERP application used SQL Server 2008 R2. The new version will use SQL Server 2012. The ERP application relies on an import process to load supplier data. The import process updates thousands of rows simultaneously, requires exclusive access to the database, and runs daily. You receive several support calls reporting unexpected behavior in the ERP application. After analyzing the calls, you conclude that users made changes directly to the tables in the database.

Tables
The current database schema contains a table named OrderDetails. The OrderDetails table contains information about the items sold for each purchase order. OrderDetails stores the product ID, quantities, and discounts applied to each product in a purchase order. The product price is stored in a table named Products.
The Products table was defined by using the SQL_Latinl_General_CP1_CI_AS collation. A column named ProductName was created by using the varchar data type. The database contains a table named Orders. Orders contains alt of the purchase orders from the last 12 months. Purchase orders that are older than 12 months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

Stored Procedures
The current version of the database contains stored procedures that change two tables. The following shows the relevant portions of the two stored procedures:

Customer Problems


Installation Issues
The current version of the ERP application requires that several SQL Server logins be set up to function correctly. Most customers set up the ERP application in multiple locations and must create logins multiple times.

Index Fragmentation Issues
Customers discover that clustered indexes often are fragmented. To resolve this issue, the customers defragment the indexes more frequently. All of the tables affected by fragmentation have the following columns that are used as the clustered index key:


Backup Issues
Customers who have large amounts of historical purchase order data report that backup time is unacceptable.

Search Issues
Users report that when they search product names, the search results exclude product names that contain accents, unless the search string includes the accent.

Missing Data Issues
Customers report that when they make a price change in the Products table, they cannot retrieve the price that the item was sold for in previous orders.

Query Performance Issues
Customers report that query performance degrades very quickly. Additionally, the customers report that users cannot run queries when SQL Server runs maintenance tasks.

Import Issues
During the monthly import process, database administrators receive many supports call from users who report that they cannot access the supplier data. The database administrators want to reduce the amount of time required to import the data.

Design Requirements File Storage Requirements
The ERP database stores scanned documents that are larger than 2 MB. These files must only be accessed through the ERP application. File access must have the best possible read and write performance.
Data Recovery Requirements
If the import process fails, the database must be returned to its prior state immediately.


Security Requirements
You must provide users with the ability to execute functions within the ERP application, without having direct access to the underlying tables.

Concurrency Requirements
You must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.

Question
You need to recommend a solution that meets the data recovery requirement. What should you include in the recommendation?
A. a differential backup
B. snapshot isolation
C. a transaction log backup
D. a database snapshot

Answer: D
Question 51 Case Study 2: Contoso Ltd Overview Application Overview
Contoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing a new version of the ERP application. The previous version of the ERP application used SQL Server 2008 R2. The new version will use SQL Server 2012. The ERP application relies on an import process to load supplier data. The import process updates thousands of rows simultaneously, requires exclusive access to the database, and runs daily. You receive several support calls reporting unexpected behavior in the ERP application. After analyzing the calls, you conclude that users made changes directly to the tables in the database.

Tables
The current database schema contains a table named OrderDetails. The OrderDetails table contains information about the items sold for each purchase order. OrderDetails stores the product ID, quantities, and discounts applied to each product in a purchase order. The product price is stored in a table named Products.
The Products table was defined by using the SQL_Latinl_General_CP1_CI_AS collation. A column named ProductName was created by using the varchar data type. The database contains a table named Orders. Orders contains alt of the purchase orders from the last 12 months. Purchase orders that are older than 12 months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.
Stored Procedures

The current version of the database contains stored procedures that change two tables. The following shows the relevant portions of the two stored procedures:


Customer Problems Installation Issues
The current version of the ERP application requires that several SQL Server logins be set up to function correctly. Most customers set up the ERP application in multiple locations and must create logins multiple times.

Index Fragmentation Issues
Customers discover that clustered indexes often are fragmented. To resolve this issue, the customers defragment the indexes more frequently. All of the tables affected by fragmentation have the following columns that are used as the clustered index key:


Backup Issues
Customers who have large amounts of historical purchase order data report that backup time is unacceptable.

Search Issues
Users report that when they search product names, the search results exclude product names that contain accents, unless the search string includes the accent.

Missing Data Issues

Customers report that when they make a price change in the Products table, they cannot retrieve the price that
the item was sold for in previous orders.

Query Performance Issues
Customers report that query performance degrades very quickly. Additionally, the customers report that users cannot run queries when SQL Server runs maintenance tasks.

Import Issues
During the monthly import process, database administrators receive many supports call from users who report that they cannot access the supplier data. The database administrators want to reduce the amount of time required to import the data.

Design Requirements File Storage Requirements
The ERP database stores scanned documents that are larger than 2 MB. These files must only be accessed through the ERP application. File access must have the best possible read and write performance.

Data Recovery Requirements
If the import process fails, the database must be returned to its prior state immediately.

Security Requirements
You must provide users with the ability to execute functions within the ERP application, without having direct access to the underlying tables.

Concurrency Requirements
You must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.

Question
You need to recommend changes to the ERP application to resolve the search issue. The solution must minimize the impact on other queries generated from the ERP application. What should you recommend changing?
A. the data type of the ProductName column
B. the collation of the Products table
C. the collation of the ProductName column
D. the index on the ProductName column

Answer: C
Question 52 Case Study 3: Litware, Inc Overview

You are a database administrator for a company named Litware, Inc. Litware is a book publishing house. Litware has a main office and a branch office. You are designing the database infrastructure to support a new web-based application that is being developed. The web application will be accessed at www.litwareinc.com. Both internal employees and external partners will use the application. You have an existing desktop application that uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

Requirements Planned Changes
You plan to deploy a SQL Server 2012 instance that will contain two databases named Databasel and Database2. All database files will be stored in a highly available SAN. Database1 will contain two tables named Orders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. The stored procedure is used to update order information. The stored procedure queries the Orders table twice each time the procedure executes. The rows returned from the first query must be returned on the second query unchanged along with any rows added to the table between the two read operations. Database1 will contain several queries that access data in the Database2 tables. Database2 will contain a table named Inventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clustered index on the primary key and a nonclustered index. The column that is used as the primary key will use the identity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventory will manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data in Database2 is recreated each day ad does not change until the next data creation process.
Data from Database2 will be accessed periodically by an external application named Application1. The data from Database2 will be sent to a database named App1_Db1 as soon as changes occur to the data in Database2. Litware plans to use offsite storage for all SQL Server 2012 backups.

Business Requirements
You have the following requirements: �� Costs for new licenses must be minimized. �� Private information that is accessed by Application must be stored in a secure format. �� Development effort must be minimized whenever possible. �� The storage requirements for databases must be minimized. �� System administrators must be able to run real-time reports on disk usage. �� The databases must be available if the SQL Server service fails. �� Database administrators must receive a detailed report that contains allocation errors and data corruption. �� Application developers must be denied direct access to the database tables. Applications must be denied direct access to the tables. �� You must encrypt the backup files to meet regulatory compliance requirements. The encryption strategy must minimize changes to the databases and to the applications.
Question
You need to recommend an isolation level for usp_UpdateOrderDetails. Which isolation level should

recommend?
A. repeatable read
B. serializable
C. read uncommitted
D. read committed

Answer: A
Question 53 Case Study 3: Litware, Inc Overview
You are a database administrator for a company named Litware, Inc. Litware is a book publishing house. Litware has a main office and a branch office. You are designing the database infrastructure to support a new web-based application that is being developed. The web application will be accessed at www.litwareinc.com. Both internal employees and external partners will use the application. You have an existing desktop application that uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

Requirements Planned Changes
You plan to deploy a SQL Server 2012 instance that will contain two databases named Databasel and Database2. All database files will be stored in a highly available SAN. Database1 will contain two tables named Orders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. The stored procedure is used to update order information. The stored procedure queries the Orders table twice each time the procedure executes. The rows returned from the first query must be returned on the second query unchanged along with any rows added to the table between the two read operations. Database1 will contain several queries that access data in the Database2 tables. Database2 will contain a table named Inventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clustered index on the primary key and a nonclustered index. The column that is used as the primary key will use the identity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventory will manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data in Database2 is recreated each day ad does not change until the next data creation process.
Data from Database2 will be accessed periodically by an external application named Application1. The data from Database2 will be sent to a database named App1_Db1 as soon as changes occur to the data in Database2. Litware plans to use offsite storage for all SQL Server 2012 backups.
Business Requirements
You have the following requirements:

�� Costs for new licenses must be minimized. �� Private information that is accessed by Application must be stored in a secure format. �� Development effort must be minimized whenever possible. �� The storage requirements for databases must be minimized. �� System administrators must be able to run real-time reports on disk usage. �� The databases must be available if the SQL Server service fails. �� Database administrators must receive a detailed report that contains allocation errors and data corruption. �� Application developers must be denied direct access to the database tables. Applications must be denied direct access to the tables. �� You must encrypt the backup files to meet regulatory compliance requirements. The encryption strategy must minimize changes to the databases and to the applications.

Question
You need to recommend a solution for Application 1 that meets the security requirements. What should you include in the recommendation?
A. Encrypted columns
B. Certificate Authentication
C. Signed stored procedures
D. Secure Socket Layer (SSL)

Answer: A
Question 54 Case Study 3: Litware, Inc Overview
You are a database administrator for a company named Litware, Inc. Litware is a book publishing house. Litware has a main office and a branch office. You are designing the database infrastructure to support a new web-based application that is being developed. The web application will be accessed at www.litwareinc.com. Both internal employees and external partners will use the application. You have an existing desktop application that uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

Requirements Planned Changes
You plan to deploy a SQL Server 2012 instance that will contain two databases named Databasel and Database2. All database files will be stored in a highly available SAN. Database1 will contain two tables named Orders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. The stored procedure is used to update order information. The stored procedure queries the Orders table twice each time the procedure executes. The rows returned from the first query must be returned on the second query unchanged along with any rows added to the table between the two read operations. Database1 will contain several queries that access data in the Database2 tables. Database2 will contain a table named

Inventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clustered index on the primary key and a nonclustered index. The column that is used as the primary key will use the identity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventory will manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data in Database2 is recreated each day ad does not change until the next data creation process.
Data from Database2 will be accessed periodically by an external application named Application1. The data from Database2 will be sent to a database named App1_Db1 as soon as changes occur to the data in Database2. Litware plans to use offsite storage for all SQL Server 2012 backups.

Business Requirements
You have the following requirements: �� Costs for new licenses must be minimized. �� Private information that is accessed by Application must be stored in a secure format. �� Development effort must be minimized whenever possible. �� The storage requirements for databases must be minimized. �� System administrators must be able to run real-time reports on disk usage. �� The databases must be available if the SQL Server service fails. �� Database administrators must receive a detailed report that contains allocation errors and data corruption. �� Application developers must be denied direct access to the database tables. Applications must be denied direct access to the tables. �� You must encrypt the backup files to meet regulatory compliance requirements. The encryption strategy must minimize changes to the databases and to the applications.

Question
You need to recommend a solution to improve the performance of usp_UpdateInventory. The solution must minimize the amount of development effort. What should you include in the recommendation?
A. a table variable
B. a subquery
C. a common table expression
D. a cursor

Answer: C
Question 55 Case Study 3: Litware, Inc Overview
You are a database administrator for a company named Litware, Inc. Litware is a book publishing house. Litware has a main office and a branch office.

You are designing the database infrastructure to support a new web-based application that is being developed.
The web application will be accessed at www.litwareinc.com. Both internal employees and external partners will use the application. You have an existing desktop application that uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

Requirements Planned Changes
You plan to deploy a SQL Server 2012 instance that will contain two databases named Databasel and Database2. All database files will be stored in a highly available SAN. Database1 will contain two tables named Orders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. The stored procedure is used to update order information. The stored procedure queries the Orders table twice each time the procedure executes. The rows returned from the first query must be returned on the second query unchanged along with any rows added to the table between the two read operations. Database1 will contain several queries that access data in the Database2 tables. Database2 will contain a table named Inventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clustered index on the primary key and a nonclustered index. The column that is used as the primary key will use the identity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventory will manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data in Database2 is recreated each day ad does not change until the next data creation process.
Data from Database2 will be accessed periodically by an external application named Application1. The data from Database2 will be sent to a database named App1_Db1 as soon as changes occur to the data in Database2. Litware plans to use offsite storage for all SQL Server 2012 backups.

Business Requirements
You have the following requirements: �� Costs for new licenses must be minimized. �� Private information that is accessed by Application must be stored in a secure format. �� Development effort must be minimized whenever possible. �� The storage requirements for databases must be minimized. �� System administrators must be able to run real-time reports on disk usage. �� The databases must be available if the SQL Server service fails. �� Database administrators must receive a detailed report that contains allocation errors and data corruption. �� Application developers must be denied direct access to the database tables. Applications must be denied direct access to the tables. �� You must encrypt the backup files to meet regulatory compliance requirements. The encryption strategy must minimize changes to the databases and to the applications.

Question
You need to recommend a disk monitoring solution that meets the business requirements. What should you include in the recommendation?

A. a maintenance plan
B. a SQL Server Agent alert
C. an audit
D. a dynamic management view

Answer: D
Question 56 Case Study 3: Litware, Inc Overview
You are a database administrator for a company named Litware, Inc. Litware is a book publishing house. Litware has a main office and a branch office. You are designing the database infrastructure to support a new web-based application that is being developed. The web application will be accessed at www.litwareinc.com. Both internal employees and external partners will use the application. You have an existing desktop application that uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

Requirements Planned Changes
You plan to deploy a SQL Server 2012 instance that will contain two databases named Databasel and Database2. All database files will be stored in a highly available SAN. Database1 will contain two tables named Orders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. The stored procedure is used to update order information. The stored procedure queries the Orders table twice each time the procedure executes. The rows returned from the first query must be returned on the second query unchanged along with any rows added to the table between the two read operations. Database1 will contain several queries that access data in the Database2 tables. Database2 will contain a table named Inventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clustered index on the primary key and a nonclustered index. The column that is used as the primary key will use the identity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventory will manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data in Database2 is recreated each day ad does not change until the next data creation process.
Data from Database2 will be accessed periodically by an external application named Application1. The data from Database2 will be sent to a database named App1_Db1 as soon as changes occur to the data in Database2. Litware plans to use offsite storage for all SQL Server 2012 backups.

Business Requirements
You have the following requirements: �� Costs for new licenses must be minimized. �� Private information that is accessed by Application must be stored in a secure format.

�� Development effort must be minimized whenever possible. �� The storage requirements for databases must be minimized. �� System administrators must be able to run real-time reports on disk usage. �� The databases must be available if the SQL Server service fails. �� Database administrators must receive a detailed report that contains allocation errors and data corruption. �� Application developers must be denied direct access to the database tables. Applications must be denied direct access to the tables. �� You must encrypt the backup files to meet regulatory compliance requirements. The encryption strategy must minimize changes to the databases and to the applications.

Question
You need to recommend a solution to allow application users to perform UPDATE operations on the database tables. The solution must meet the business requirements. What should you recommend?
A. Create a user-defined database role and add users to the role.
B. Create stored procedures that use EXECUTE AS clauses.
C. Create functions that use EXECUTE AS clauses.
D. Create a Policy-Based Management Policy.

Answer: B
Question 57 Case Study 3: Litware, Inc Overview
You are a database administrator for a company named Litware, Inc. Litware is a book publishing house. Litware has a main office and a branch office. You are designing the database infrastructure to support a new web-based application that is being developed. The web application will be accessed at www.litwareinc.com. Both internal employees and external partners will use the application. You have an existing desktop application that uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

Requirements Planned Changes
You plan to deploy a SQL Server 2012 instance that will contain two databases named Databasel and Database2. All database files will be stored in a highly available SAN. Database1 will contain two tables named Orders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. The stored procedure is used to update order information. The stored procedure queries the Orders table twice each time the procedure executes. The rows returned from the first query must be returned on the second query unchanged along with any rows added to the table between the two read operations. Database1 will contain several queries that access data in the Database2 tables. Database2 will contain a table named Inventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clustered index on the primary key and a nonclustered index. The column that is used as the primary key will use the

identity property. Database2 will contain a stored procedure named usp_UpdateInventory.
usp_UpdateInventory will manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data in Database2 is recreated each day ad does not change until the next data creation process.
Data from Database2 will be accessed periodically by an external application named Application1. The data from Database2 will be sent to a database named App1_Db1 as soon as changes occur to the data in Database2. Litware plans to use offsite storage for all SQL Server 2012 backups.

Business Requirements
You have the following requirements: �� Costs for new licenses must be minimized. �� Private information that is accessed by Application must be stored in a secure format. �� Development effort must be minimized whenever possible. �� The storage requirements for databases must be minimized. �� System administrators must be able to run real-time reports on disk usage. �� The databases must be available if the SQL Server service fails. �� Database administrators must receive a detailed report that contains allocation errors and data corruption. �� Application developers must be denied direct access to the database tables. Applications must be denied direct access to the tables. �� You must encrypt the backup files to meet regulatory compliance requirements. The encryption strategy must minimize changes to the databases and to the applications.

Question
You need to recommend a solution for the deployment of SQL Server 2012. The solution must meet the business requirements. What should you include in the recommendation?
A. Deploy two servers that have SQL Server 2012 installed. Implement AlwaysOn Availability Groups on both servers.
B. Upgrade the existing SQL Server 2005 instance to SQL Server 2012. Deploy a new server that has SQL Server 2012 installed. Implement AlwaysOn.
C. Install a new instance of SQL Server 2012 on the server that hosts the SQL Server 2005 instance. Deploy a new server that has SQL Server 2012 installed. Implement AlwaysOn.
D. Deploy two servers that have SQL Server 2012 installed and implement Failover Clustering.

Answer: C
Question 58 Case Study 3: Litware, Inc Overview

You are a database administrator for a company named Litware, Inc. Litware is a book publishing house. Litware has a main office and a branch office. You are designing the database infrastructure to support a new web-based application that is being developed. The web application will be accessed at www.litwareinc.com. Both internal employees and external partners will use the application. You have an existing desktop application that uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

Requirements Planned Changes
You plan to deploy a SQL Server 2012 instance that will contain two databases named Databasel and Database2. All database files will be stored in a highly available SAN. Database1 will contain two tables named Orders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. The stored procedure is used to update order information. The stored procedure queries the Orders table twice each time the procedure executes. The rows returned from the first query must be returned on the second query unchanged along with any rows added to the table between the two read operations. Database1 will contain several queries that access data in the Database2 tables. Database2 will contain a table named Inventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clustered index on the primary key and a nonclustered index. The column that is used as the primary key will use the identity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventory will manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data in Database2 is recreated each day ad does not change until the next data creation process.
Data from Database2 will be accessed periodically by an external application named Application1. The data from Database2 will be sent to a database named App1_Db1 as soon as changes occur to the data in Database2. Litware plans to use offsite storage for all SQL Server 2012 backups.

Business Requirements
You have the following requirements: �� Costs for new licenses must be minimized. �� Private information that is accessed by Application must be stored in a secure format. �� Development effort must be minimized whenever possible. �� The storage requirements for databases must be minimized. �� System administrators must be able to run real-time reports on disk usage. �� The databases must be available if the SQL Server service fails. �� Database administrators must receive a detailed report that contains allocation errors and data corruption. �� Application developers must be denied direct access to the database tables. Applications must be denied direct access to the tables. �� You must encrypt the backup files to meet regulatory compliance requirements. The encryption strategy must minimize changes to the databases and to the applications.
Question
You need to recommend a solution to synchronize Database2 to App1_Db1. What should you recommend?

A. Change data capture
B. Snapshot replication
C. Transactional replication
D. Master Data Services

Answer: A
Question 59 Case Study 4: Application Scenario 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_UpdateEmployeeName 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



Question
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: BC
Question 60 Case Study 4: Application Scenario 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_UpdateEmployeeName 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



Question
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: B
Question 61 Case Study 4: Application Scenario


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_UpdateEmployeeName 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



Question
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 TABLE EmployeesInfo
D. CREATE SCHEMA EmployeesInfo

Answer: B
Question 62 Case Study 4: Application Scenario 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_UpdateEmployeeName 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



Question
You need to add a new column named Confirmed to the Employees table. The solution must meet the following requirements: �� Have a default value of TRUE. �� Minimize the amount of disk space used. Which code segment should you use?
A. ALTER TABLE Employees ADD Confirmed bit DEFAULT 0;
B. ALTER TABLE Employees ADD Confirmed char(1) DEFAULT "1";
C. ALTER TABLE Employees ADD Confirmed char(1) DEFAULT '0';
D. ALTER TABLE Employees ADD Confirmed bit DEFAULT 1;


Answer: D
Question 63 Case Study 4: Application Scenario 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_UpdateEmployeeName 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



Question
You need to modify usp_SelectEmployeesByName to support server-side paging. The solution must minimize the amount of development effort required. What should you add to usp_SelectEmployeesByName?
A. an OFFSET-FETCH clause
B. a recursive common table expression
C. a table variable
D. the ROWNUMBER keyword

Answer: A
Question 64 Case Study 5: Manufacturing Company
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.es. 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 Manufacturing Steps table must refer to a Product by the same 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

CategoryFromType.sql


IndexManagement.sql



Question
You need to modify Production.ProductDetails_Insert to comply with the application requirements. Which code segment should you execute?
A. ADD SIGNATURE TO Production.ProductDetails_Insert BY CERTIFICATE PRODUCTSCERT;
B. OPEN DBCERT; ALTER PROCEDURE Production. ProductDetails_Insert WITH ENCRYPTION; CLOSE D3CERT;
C. ADD SIGNATURE TO Production.ProductDetails_Insert BY CERTIFICATE DBCERT;

D. OPEN PRODUCTSCERT; ALTER PROCEDURE Production. ProductDetails_Insert WITH ENCRYPTION; CLOSE PRODUCTSCERT;

Answer: C
Question 65 Case Study 5: Manufacturing Company

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.es. 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 Manufacturing Steps table must refer to a Product by the same 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

CategoryFromType.sql


IndexManagement.sql



Question
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: D
QUESTION 66 Case Study 5: Manufacturing Company

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.es. 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 Manufacturing Steps table must refer to a Product by the same 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


CategoryFromType.sql


IndexManagement.sql



Question
You are planning the ManufacturingSteps table. You need to define the ProductID column in the CREATE TABLE statement. Which code segment should you use?


A. Option A
B. Option B
C. Option C
D. Option D

Answer: A
Question 67 Case Study 5: Manufacturing Company

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.es. 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 Manufacturing Steps table must refer to a Product by the same 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


CategoryFromType.sql


IndexManagement.sql



Question
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: ACDE
Question 68 Case Study 5: Manufacturing Company

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.es. 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 Manufacturing Steps table must refer to a Product by the same 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


CategoryFromType.sql


IndexManagement.sql



Question
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. Option A
B. Option B
C. Option C
D. Option D

Answer: C
Question 69 Case Study 6: Database Application Scenario 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



Question
You need to provide referential integrity between the Sessions table and Speakers table. Which code segment should you add at line 47 of Tables.sql?


A. Option A
B. Option B
C. Option C
D. Option D

Answer: C
Question 70 Case Study 6: Database Application Scenario 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



Question
You need to add a new column named Confirmed to the Attendees table. The solution must meet the following requirements: �� Have a default value of false. �� Minimize the amount of disk space used. Which code block should you use?

A. ALTER TABLE Attendees ADD Confirmed bit DEFAULT 0;
B. ALTER TABLE Attendees ADD Confirmed char(1) DEFAULT '0';
C. ALTER TABLE Attendees ADD Confirmed char(1) DEFAULT '1';
D. ALTER TABLE Attendees ADD Confirmed bit DEFAULT 1;

Answer: A
Question 71 Case Study 6: Database Application Scenario 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



Question
You are evaluating the table design. You need to recommend a change to Tables.sql that reduces the amount of time it takes for usp_AttendeesReport to execute. What should you add at line 14 of Tables.sql?
A. FullName AS (FirstName + ' ' + LastName),
B. FullName nvarchar(100) NOT NULL DEFAULT (dbo.CreateFuIlName(FirstName, LastName)),

C. FullName AS (FirstName + ' ' + LastName) PERSISTED,
D. FullName nvarchar(100) NOT NULL CONSTRAINT DF_FullName DEFAULT (dbo.CreateFullName (FirstName, LastName)),

Answer: C
Question 72 Case Study 6: Database Application Scenario 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



Question
You need to modify usp_SelectSpeakersByName to support server-side paging. The solution must minimize the amount of development effort required. What should you add to usp_SelectSpeakersByName?
A. a table variable

B. an OFFSET-FETCH clause
C. the ROWNUMBER keyword
D. a recursive common table expression

Answer: B
Question 73 Case Study 6: Database Application Scenario 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



Question
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 (FCRCESCAN)

B. OPTION (OPTIMIZE FOR UNKNOWN)
C. OPTION (OPTIMIZE FOR (@LastName = 'Anderson'))
D. OPTION (FORCESEEK)

Answer: B
Question 74 Case Study 7: Invoice Schema Scenario Application Information
Your company receives invoices in XML format from customers. Currently, the invoices are stored as files and processed by a desktop application. The application has several performance and security issues. The application is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has been created for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must be stored and processed as-is. Users cannot filter the data provided through views. You are designing a SQL Server database named DB1 that will be used to receive, process, and securely store the invoice data. A third-party Microsoft .NET Framework component will be purchased to perform tax calculations. The third-party tax component will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. The component will expose a class named TreyResearch and a method named Amortize(). The files are located in c:\temp\. The following graphic shows the planned tables:

You have a sequence named Accounting.InvoiceID_Seq. You plan to create two certificates named CERT1 and CERT2. You will create CERT1 in master. You will create CERT2 in DB1. You have a legacy application that requires the ability to generate dynamic T-SQL statements against DB1. A sample of the queries generated by the legacy application appears in Legacy.sql.

Application Requirements
The planned database has the following requirements:

�� All stored procedures must be signed. �� The original XML invoices must be stored in the database. �� An XML schema must be used to validate the invoice data. �� Dynamic T-SQL statements must be converted to stored procedures. �� Access to the .NET Framework tax components must be available to T-SQL objects. �� Columns must be defined by using data types that minimize the amount of space used by each table. �� Invoices stored in the InvoiceStatus table must refer to an invoice by the same identifier used by the Invoice table. �� To protect against the theft of backup disks, invoice data must be protected by using the highest level of encryption. �� The solution must provide a table-valued function that provides users with the ability to filter invoices by customer. �� Indexes must be optimized periodically based on their fragmentation by using the minimum amount of administrative effort.
Usp_InsertInvoices.sql

Invoices.xml

All customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. The remaining eight digits are the customer's account number. The following is a sample of a customer invoice in XML format:

InvoicesByCustomer.sql

Legacy.sql

CountryFromID.sqf


IndexManagement.sql



Question
You need to modify the function in CountryFromID.sql to ensure that the country name is returned instead of the country ID. Which line of code should you modify in CountryFromID.sql?
A. 404
B. 06
C. 19
D. 05
Answer: C Question 75 Case Study 7: Invoice Schema Scenario Application Information

Your company receives invoices in XML format from customers. Currently, the invoices are stored as files and processed by a desktop application. The application has several performance and security issues. The application is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has been created for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must be stored and processed as-is. Users cannot filter the data provided through views. You are designing a SQL Server database named DB1 that will be used to receive, process, and securely store the invoice data. A third-party Microsoft .NET Framework component will be purchased to perform tax calculations. The third-party tax component will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. The component will expose a class named TreyResearch and a method named Amortize(). The files are located in c:\temp\. The following graphic shows the planned tables:

You have a sequence named Accounting.InvoiceID_Seq. You plan to create two certificates named CERT1 and CERT2. You will create CERT1 in master. You will create CERT2 in DB1. You have a legacy application that requires the ability to generate dynamic T-SQL statements against DB1. A sample of the queries generated by the legacy application appears in Legacy.sql.

Application Requirements
The planned database has the following requirements: �� All stored procedures must be signed. �� The original XML invoices must be stored in the database. �� An XML schema must be used to validate the invoice data. �� Dynamic T-SQL statements must be converted to stored procedures. �� Access to the .NET Framework tax components must be available to T-SQL objects. �� Columns must be defined by using data types that minimize the amount of space used by each table. �� Invoices stored in the InvoiceStatus table must refer to an invoice by the same identifier used by the Invoice

table.
�� To protect against the theft of backup disks, invoice data must be protected by using the highest level of encryption. �� The solution must provide a table-valued function that provides users with the ability to filter invoices by customer. �� Indexes must be optimized periodically based on their fragmentation by using the minimum amount of administrative effort.
Usp_InsertInvoices.sql


Invoices.xml
All customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. The remaining eight digits are the customer's account number. The following is a sample of a customer invoice in XML format:


InvoicesByCustomer.sql

Legacy.sql

CountryFromID.sqf


IndexManagement.sql



Question
Which data type should you use for CustomerlD?
A. varchar(11)
B. bigint
C. nvarchar(11)
D. char(11)
Answer: A Question 76

You have a SQL Server 2012 database named database1. Database1 has a data file named databasel_data.mdf and a transaction log file named databaseljog.ldf. Databasel_data.mdf is 1.5 GB. Databaseljog.ldf is 1.5 terabytes. A full backup of Database1 is performed every day. You need to reduce the size of the log file. The solution must ensure that you can perform transaction log backups in the future. 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.

A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
F. Option F

Answer: ACDE
Question 77 Case Study 7: Invoice Schema Scenario Application Information
Your company receives invoices in XML format from customers. Currently, the invoices are stored as files and processed by a desktop application. The application has several performance and security issues. The application is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has been created for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must be stored and processed as-is. Users cannot filter the data provided through views. You are designing a SQL Server database named DB1 that will be used to receive, process, and securely store the invoice data. A third-party Microsoft .NET Framework component will be purchased to perform tax calculations. The third-party tax component will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. The component will expose a class named TreyResearch and a method named Amortize(). The files are located in c:\temp\. The following graphic shows the planned tables:


You have a sequence named Accounting.InvoiceID_Seq. You plan to create two certificates named CERT1 and CERT2. You will create CERT1 in master. You will create CERT2 in DB1. You have a legacy application that requires the ability to generate dynamic T-SQL statements against DB1. A sample of the queries generated by the legacy application appears in Legacy.sql.

Application Requirements
The planned database has the following requirements: �� All stored procedures must be signed. �� The original XML invoices must be stored in the database. �� An XML schema must be used to validate the invoice data. �� Dynamic T-SQL statements must be converted to stored procedures. �� Access to the .NET Framework tax components must be available to T-SQL objects. �� Columns must be defined by using data types that minimize the amount of space used by each table. �� Invoices stored in the InvoiceStatus table must refer to an invoice by the same identifier used by the Invoice table. �� To protect against the theft of backup disks, invoice data must be protected by using the highest level of encryption. �� The solution must provide a table-valued function that provides users with the ability to filter invoices by

customer. �� Indexes must be optimized periodically based on their fragmentation by using the minimum amount of administrative effort.
Usp_InsertInvoices.sql


Invoices.xml
All customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. The remaining eight digits are the customer's account number. The following is a sample of a customer invoice in XML format:


InvoicesByCustomer.sql

Legacy.sql

CountryFromID.sqf


IndexManagement.sql



Question
You need to modify InsertInvoice to comply with the application requirements. Which code segment should you execute?


A. Option A
B. Option B
C. Option C
D. Option D

Answer: B
Question 78 Case Study 7: Invoice Schema Scenario Application Information
Your company receives invoices in XML format from customers. Currently, the invoices are stored as files and processed by a desktop application. The application has several performance and security issues. The application is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has been created for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must be stored and processed as-is. Users cannot filter the data provided through views. You are designing a SQL Server database named DB1 that will be used to receive, process, and securely store the invoice data. A third-party Microsoft .NET Framework component will be purchased to perform tax calculations. The third-party tax component will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. The component will expose a class named TreyResearch and a method named Amortize(). The files are located in c:\temp\. The following graphic shows the planned tables:


You have a sequence named Accounting.InvoiceID_Seq. You plan to create two certificates named CERT1 and CERT2. You will create CERT1 in master. You will create CERT2 in DB1. You have a legacy application that requires the ability to generate dynamic T-SQL statements against DB1. A sample of the queries generated by the legacy application appears in Legacy.sql.

Application Requirements
The planned database has the following requirements: �� All stored procedures must be signed. �� The original XML invoices must be stored in the database. �� An XML schema must be used to validate the invoice data. �� Dynamic T-SQL statements must be converted to stored procedures. �� Access to the .NET Framework tax components must be available to T-SQL objects. �� Columns must be defined by using data types that minimize the amount of space used by each table. �� Invoices stored in the InvoiceStatus table must refer to an invoice by the same identifier used by the Invoice table. �� To protect against the theft of backup disks, invoice data must be protected by using the highest level of encryption. �� The solution must provide a table-valued function that provides users with the ability to filter invoices by customer. �� Indexes must be optimized periodically based on their fragmentation by using the minimum amount of administrative effort.
Usp_InsertInvoices.sql



Invoices.xml
All customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. The remaining eight digits are the customer's account number. The following is a sample of a customer invoice in XML format:

InvoicesByCustomer.sql


Legacy.sql

CountryFromID.sqf

IndexManagement.sql



Question
You need to convert the functionality of Legacy.sql to use a stored procedure. Which code segment should the stored procedure contain?


A. Option A
B. Option B
C. Option C
D. Option D
Answer: D