70-459 84 Q&S 2008 or MCITP: Database Administrator&Developer 2008 to MCSE: Data Platform

Which code segment should the stored procedure contain?

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.sql

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. CREATE PROC usp_InvoicesByCustomerAboveTotal (
@sqlstring AS nvarchar(1000),
OUTPUT @CustomerID AS char(11),
OUTPUT @Total AS decimal(8,2))
AS
•..
B. CREATE PROC usp_InvoicesByCustomerAboveTotal (
@sqlstring AS nvarchar(1000),
@CustomerID AS char(11),
@Total AS decimal(8,2))
AS
•..
C. CREATE PROC usp_InvoicesByCustomerAboveTotal (
@sqlstring AS nvarchar(1000))
AS
•..
D. CREATE PROC usp_InvoicesByCustomerAboveTotal (
@CustomerID AS char(11), @Total AS decimal(8,2))
AS
•..


Answer Clike
Which code segment should you use to create the stored procedure?

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.sql

IndexManagement.sql

------------
Question
You need to build a stored procedure that amortizes the invoice amount. Which code segment should you use to create the stored procedure? To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.
Build List and Reorder:



Answer Clike
Which code segment should you execute?

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.sql

IndexManagement.sql

------------
Question
You need to modify InsertInvoice to comply with the application requirements. Which code segment should you execute?
A. OPEN CERT1;
ALTER PROCEDURE InsertInvoice
WITH ENCRYPTION;
CLOSE CERT1;
B. ADD SIGNATURE TO InsertInvoice
BY CERTIFICATE CERT2;
C. OPEN CERT2;
ALTER PROCEDURE InsertInvoice
WITH ENCRYPTION;
CLOSE CERT2;
D. ADD SIGNATURE TO InsertInvoice
BY CERTIFICATE CERT1;


Answer Clike
Which data type should you use for CustomerlD?

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.sql

IndexManagement.sql

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


Answer Clike
Which line of code should you modify in CountryFromID.sql?

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.sql

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. 04
B. 06
C. 19
D. 05


Answer Clike
What should you add at line 14 of Tables.sql?

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 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 to support a rewrite of usp_AttendeesReport. You need to recommend a change to Tables.sql that will help reduce 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.CreateFullName(FirstName, LastName)),
C. FullName AS (FirstName + ‘ ‘ + LastName) PERSISTED,
D. FullName nvarchar(100) NOT NULL CONSTRAINT DF_FullName DEFAULT (dbo.CreateFullName (FirstName, LastName)),


Answer Clike
What should you add to usp_SelectSpeakersByName?

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 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 Clike
What should you add at line 30 of Procedures.sql?

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 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 (FORCESCAN)
B. OPTION (OPTIMIZE FOR UNKNOWN)
C. OPTION (OPTIMIZE FOR (@LastName = ‘Anderson’))
D. OPTION (FORCESEEK)


Answer Clike
Which code segment should you add at line 47 of Tables.sql?

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 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. ALTER TABLE dbo.Sessions ADD CONSTRAINT
FK_Sessions_Speakers FOREIGN KEY (SessionID)
REFERENCES dbo.Speakers (SpeakerID);
B. ALTER TABLE dbo.Speakers ADD CONSTRAINT
FK_Speakers_Sessions FOREIGN KEY (SessionID)
REFERENCES dbo.Sessions (SessionID);
C. ALTER TABLE dbo.Sessions ADD CONSTRAINT
FK_Sessions_Speakers FOREIGN KEY (SpeakerID)
REFERENCES dbo.Speakers (SpeakerID);
D. ALTER TABLE dbo.Speakers ADD CONSTRAINT
FK_Speakers_Sessions FOREIGN KEY (SpeakerID)
REFERENCES dbo.Sessions (SessionID);


Answer Clike
Which code block should you use?

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 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 Clike
Which code segment should you use?

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 ManufacturingSteps table must refer to a Product by the same ProductID.
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 implement Transparent Data Encryption (TDE) on ProductsDB. Which code segment should you use?
A. USE PRODUCTSDB;
GO
CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = TRIPLE_DES_3KEY
ENCRYPTION BY SERVER CERTIFICATE DBCERT;
GO
ALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;
GO
B. USE PRODUCTSDB;
GO
CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = TRIPLE_DES_3KEY
ENCRYPTION BY SERVER CERTIFICATE PRODUCTSCERT;
GO
ALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;
GO
C. USE PRODUCTSDB;
GO
CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256
ENCRYPTION BY SERVER CERTIFICATE PRODUCTSCERT;
GO
ALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;
GO
D. USE PRODUCTSDB;
GO
CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256
ENCRYPTION BY SERVER CERTIFICATE DBCERT;
GO
ALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;
GO


Answer Clike
Which code segment should you use?

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 ManufacturingSteps table must refer to a Product by the same ProductID.
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. ProductID bigint FOREIGN KEY REFERENCES
Production.Product(ProductID) NOT NULL,
B. ProductID bigint DEFAULT
(NEXT VALUE FOR Production.ProductID_Seq) NOT NULL,
C. ProductID bigint DEFAULT
((NEXT VALUE FOR Production.ProductID_Seq OVER
(ORDER BY ManufacturingStepID))) NOT NULL FOREIGN KEY REFERENCES
Production.Product(ProductID),
D. ProductID bigint DEFAULT
((NEXT VALUE FOR Production.ProductID_Seq OVER
(ORDER BY ManufacturingStepID))) NOT NULL,


Answer Clike
Which code segments should you execute?

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 ManufacturingSteps table must refer to a Product by the same ProductID.
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. CREATE ASSEMBLY ProductionAssembly FROM ‘C:ProductsProcessProducts.DLL’;
B. EXEC sp_recompile @objname = ‘Production.ProcessProduct’;
C. RECONFIGURE;
D. EXEC sp_configure ‘clr enabled’, ‘1’;
E. CREATE ASSEMBLY ProductionAssembly FROM ‘C:ProductsProcessProducts.cs’;
F. CREATE PROCEDURE Production.ProcessProduct(
@ProductID int, @ProductType varchar(11)
)
AS EXTERNAL NAME ProductionAssembly.ProcessProduct.Process;
G. CREATE TYPE Production.ProcessProduct
EXTERNAL NAME ProductionAssembly.ProcessProducts.Process;


Answer Clike
Which code segment should you execute?

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 ManufacturingSteps table must refer to a Product by the same ProductID.
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 DBCERT;
C. ADD SIGNATURE TO Production.ProductDetails_Insert
BY CERTIFICATE DBCERT;
D. OPEN PRODUCTSCERT;
ALTER PROCEDURE Production.ProductDetails_Insert
WITH ENCRYPTION;
CLOSE PRODUCTSCERT;


Answer Clike
Which code segment should you use to complete the function?

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 ManufacturingSteps table must refer to a Product by the same ProductID.
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. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))
RETURNS @tblInvoices TABLE (ProductID bigint, ProductType varchar(11), CreationDate date)
AS
B. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))
RETURNS xml
AS
RETURN
C. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))
RETURNS @tblInvoices TABLE (ProductID bigint, ProductType varchar(11), CreationDate date)
AS
INSERT INTO @tblInvoices
D. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))
RETURNS TABLE
AS
RETURN


Answer Clike
Which code segment should you use?

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 Clike
Which code segment should you use?

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 Clike
What should you add to usp_SelectEmployeesByName?

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 Clike
Which code segment or segments should you add at line 28 of Tables.sql?

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 28 of Tables.sql? (Each correct answer presents part of the solution. Choose all that apply.)
A. ALTER TABLE dbo.Offices ADD CONSTRAINT
FK_Offices_Employees FOREIGN KEY (EmployeeID)
REFERENCES dbo.Employees (EmployeeID);
B. ALTER TABLE dbo.Offices ADD CONSTRAINT
PK_Offices_EmployeeID PRIMARY KEY (EmployeeID);
C. ALTER TABLE dbo.Employees ADD CONSTRAINT
PK_Employees_EmployeeID PRIMARY KEY (EmployeeID);
D. ALTER TABLE dbo.Employees ADD CONSTRAINT
FK_Employees_Offices FOREIGN KEY (OfficeID)
REFERENCES dbo.Offices (OfficeID);


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

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 Clike
What should you recommend?

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 Database1 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 and 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 Application1 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 Clike
What should you include in the recommendation?

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 Database1 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 and 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 Application1 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 Clike
What should you include in the recommendation?

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 Database1 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 and 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 Application1 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 Clike
What should you include in the recommendation?

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 Database1 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 and 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 Application1 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 Clike
What should you recommend?

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 Database1 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 and 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 Application1 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 Clike
What should you include in the recommendation?

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 Database1 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 and 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 Application1 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 Application1 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 Clike
What should you include in the recommendation?

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_Latin1_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 all 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 Clike
What should you include in the recommendation?

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_Latin1_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 all 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 Clike
What should you recommend changing?

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_Latin1_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 all 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 Clike
Which isolation level should recommend?

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 Database1 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 and 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 Application1 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 Clike
Which change should you recommend?

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 Clike
What should you recommend?

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_Latin1_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 all 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 Clike
What should you include in the recommendation?

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_Latin1_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 all 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 Clike
What should you include in the recommendation?

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 Clike
What should you recommend replacing Table1?

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. an indexed view
D. a table variable


Answer Clike
What should you include in the recommendation?

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. AlwaysOn Availability Groups
C. SQL Server Failover Clustering
D. Peer-to-peer replication


Answer Clike
Which change should you recommend?

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 Clike
What should you include in the recommendation?

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 Clike
Which keyword should you identify?

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 Clike
What should you recommend?

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 Clike
Which code segment should you execute?

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. BACKUP LOG DB1 TO Device1 WITH TRUNCATE_ONLY
B. BACKUP LOG DB1 TO Device1 WITH COPY_ONLY
C. BACKUP LOG DB1 TO Device1 WITH NORECOVERY
D. BACKUP LOG DB1 TO Device1


Answer Clike
What should you do?

You execute the following code.

After populating the Employees table with 10,000 rows, you execute the following query:

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%’.
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) = ‘C’ to LEFT(JobTitle ,1) = ‘C’.


Answer Clike
What should you use?

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 Clike
What should you implement?

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 Clike
What should you set from the index options?

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 Clike
WHERE Column2 IS NOT NULL

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 (Column2)
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 Clike
However, you receive the following error message:

You are migrating a database named Orders to a new server that runs Microsoft SQL Server 2012. You attempt to add a SQL login, [User1], to the database. However, you receive the following error message:
"User already exists in current database."
You need to configure the [User1] login to be able to access the Orders database and retain the original permissions. You need to achieve this goal by using the minimum required permissions. Which Transact-SQL statement should you use?
A. DROP USER [User1];
CREATE USER [User1] FOR LOGIN [User1];
ALTER ROLE [db_owner] ADD MEMBER [User1];
B. ALTER ROLE [db_owner] ADD MEMBER [User1];
C. ALTER USER [User1] WITH LOGIN [User1];
D. ALTER SERVER ROLE [sysadmin] ADD MEMBER [User1];


Answer Clike
Which code segment should you run?

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. EXEC sp_refreshview @viewname = ‘dbo.View1’;
B. ALTER dbo.View1 WITH SCHEMABINDING, VIEW_METADATA
AS
SELECT t1.col1, t1.col2, t2.*
FROM dbo.Table1 AS t1 JOIN dbo.Table2 AS t2
ON t1.col1 = t2.col2;
C. DROP dbo.View1;
GO
CREATE dbo.View1 WITH SCHEMABINDING, VIEW_METADATA
AS
SELECT t1.col1, t1.col2, t2.*
FROM dbo.Table1 AS t1 JOIN dbo.Table2 AS t2
ON t1.col1 = t2.col2;
D. EXEC sp_refreshsqlmodule @name = ‘dbo.Table2’;


Answer Clike
What should you use?

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 Clike
What should you do?

You administer a Microsoft SQL Server 2012 failover cluster that contains two nodes named Node A and Node B. A single instance of SQL Server is installed on the cluster. An additional node named Node C has been added to the existing cluster. You need to ensure that the SQL Server instance can use all nodes of the cluster. What should you do?
A. Create a ConfigurationFile.ini file from Node B, and then run the AddNode command-line tool on Node A.
B. Use Node A to install SQL Server on Node C.
C. Run the Add Node to SQL Server Failover Cluster Wizard on Node C.
D. Use Cluster Administrator to add a new Resource Group to Node B.
E. Run the New SQL Server stand-alone installation Wizard on Node C.
F. Use Node B to install SQL Server on Node C.


Answer Clike
Which code segment should you add at line 06?

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 Column1.
Which code segment should you add at line 06?
A. WITH VIEW_METADATA
B. WITH ENCRYPTION
C. WITH CHECK OPTION
D. WITH SCHEMABINDING


Answer Clike
What should you do?

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 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 Clike
What should you recommend?

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 Clike
What should you do?

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 Clike
What should you recommend?

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 Clike
What should you do?

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 Clike
What should you implement?

You run the following code:

You need to ensure that the root node of the XML data stored in the Details column is <Order_Details>. 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 Clike
What should you do?

Your company has a SQL Azure subscription. You implement a database named Database1. In Database1, you create 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 Clike
What should you set from the index options?

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 Clike
What should you do?

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 Clike
What should you do?

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. Run the following: ALTER TABLE Sales ALTER COLUMN OrderDate datetime NOT NULL;
B. Change the WHERE clause to the following: WHERE OrderDate > @date1 AND OrderDate < @date2
C. Remove the ORDER BY clause from the stored procedure.
D. Run the following:
DROP INDEX IX_Sales_OrderDate;
GO
CREATE INDEX IX_Sales_OrderDate ON Sales(OrderDate);
GO


Answer Clike
Which code segment should you execute before you remove Column1?

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 one-way hashing. 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.
Build List and Reorder:



Answer Clike
Which type of objects should you identify?

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 Clike
Which code segment should you add at line 03?

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-insensitive and accent-insensitive.
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_AS NOT NULL,
D. UserName varchar(200) COLLATE Latin1_General_CS_AS NOT NULL,
E. UserName nvarchar(200) COLLATE Latin1_General_CI_AS NOT NULL,
F. UserName varchar(200) COLLATE Latin1_General_CI_AS NOT NULL,


Answer Clike
Which technologies should you recommend?

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.
Select and Place:



Answer Clike
What should you do?

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. Run the following: ALTER TABLE Sales ALTER COLUMN OrderDate datetime NOT NULL;
B. Change the WHERE clause to the following: WHERE OrderDate BETWEEN CAST(@date1,char(10)) AND CAST(@date2,char(10))
C. Remove the ORDER BY clause from the stored procedure.
D. Run the following:
DROP INDEX IX_Sales_OrderDate;
GO
CREATE INDEX IX_Sales_OrderDate ON Sales(OrderDate);
GO


Answer Clike
How many servers should you identify?

DRAG DROP
You plan to install two SQL Server 2012 environments named Environment1 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.
Select and Place:



Answer Clike
What should you include in the recommendation?

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 Clike
Which data types should you recommend for each column?

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.
Select and Place:



Answer Clike
Which features should you identify?

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.
Select and Place:



Answer Clike
Which technologies should you identify?

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.)
Select and Place:



Answer Clike
Which options should you recommend?

DRAG DROP
You plan to deploy SQL Server 2012. You must create two tables named Table1 and Table2 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.
Select and Place:



Answer Clike
Which technologies should you identify?

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.
Select and Place:



Answer Clike
What should you create?

DRAG DROP
You execute the following code:
CREATE TABLE 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.
Build List and Reorder:



Answer Clike
Which features should you identify?

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.
Select and Place:



Answer Clike
Which code segment should you execute before you remove Column1?

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.
Build List and Reorder:



Answer Clike
Which features should you identify?

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.
Select and Place:



Answer Clike
What should you do?

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 Clike
Which code segment should you execute?

You have a SQL Server 2012 database named Database1. Database1 has a data file named database1_data.mdf and a transaction log file named database1_Log.ldf. Database1_Data.mdf is 1.5 GB. Database1_Log.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.
Build List and Reorder:



Answer Clike
Which code segment should you add at line 03?

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_AS NOT NULL,
D. UserName varchar(200) COLLATE Latin1_General_CS_AS NOT NULL,
E. UserName nvarchar(200) COLLATE Latin1_General_CI_AS NOT NULL,
F. UserName varchar(200) COLLATE Latin1_General_CI_AS NOT NULL,


Answer Clike
What should you recommend?

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 (EFS)
D. Transparent Data Encryption (TDE)


Answer Clike
What should you recommend?

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)
E. SQL Data Sync


Answer Clike
Which code segment should you use?

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. CREATE TABLE Table1 (
ID int IDENTITY(1,1),
Name varchar(100),
Version uniqueidentifier DEFAULT NEWID())
INSERT INTO Table1 (Name, Version)
VALUES (‘Smith, Ben’)
B. CREATE TABLE Table1 (
ID int IDENTITY(1,1),
Name varchar(100),
Version rowversion)
INSERT INTO Table1 (Name, Version)
VALUES (‘Smith, Ben’, NEWID())
C. CREATE TABLE Table1 (
ID int IDENTITY(1,1),
Name varchar(100),
Version uniqueidentifier DEFAULT NEWID())
INSERT INTO Table1 (Name, Version)
VALUES (‘Smith, Ben’, NEWID())
D. CREATE TABLE Table1 (
ID int IDENTITY(1,1),
Name varchar(100),
Version rowversion)
INSERT INTO Table1 (Name)
VALUES (‘Smith, Ben’)


Answer Clike
Which tool should you use?

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 Clike