309
Transition Your MCITP: Database Administrator 2008 or MCITP: Database Developer 2008 to MCSE: Data Platform Number : 70-459 Passing Score : 700 Time Limit : 180 min File Version : 1.1 http://www.gratisexam.com/ 70-459

Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Number: 70-459Passing Score: 700Time Limit: 180 minFile Version: 1.1

http://www.gratisexam.com/

70-459

Page 2: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Exam A

QUESTION 1You have an application that uses a view to access data from multiple tables. You need to ensure that you caninsert 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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:References:http://msdn.microsoft.com/en-us/library/ms180800.aspxhttp://msdn.microsoft.com/en-us/library/ms187956.aspx

You can modify the data of an underlying base table through a view, as long as the following conditions aretrue:

Any modifications, including UPDATE, INSERT, and DELETE statements, must reference columns fromonly one base table.The columns being modified in the view must directly reference the underlying data in the table columns.The columns cannot be derived in any other way, such as through the following:

1. An aggregate function: AVG, COUNT, SUM, MIN, MAX, GROUPING, STDEV, STDEVP, VAR, and VARP.2. A computation. The column cannot be computed from an expression that uses other columns. Columns that

are formed by using the set operators UNION, UNION ALL, CROSSJOIN, EXCEPT, and INTERSECTamount to a computation and are also not updatable.The columns being modified are not affected by GROUP BY, HAVING, or DISTINCT clauses.TOP is not used anywhere in the select_statement of the view together with the WITH CHECK OPTIONclause.

Materialize the view.In SQL this is an indexed view

CHECK OPTIONForces all data modification statements executed against the view to follow the criteria set withinselect_statement. When a row is modified through a view, the WITH CHECK OPTION makes sure the dataremains visible through the view after the modification is committed. Any updates performed directly to a view'sunderlying tables are not verified against the view, even if CHECK OPTION is specified.

SCHEMABINDINGBinds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the basetable or tables cannot be modified in a way that would affect the view definition. The view definition itself mustfirst be modified or dropped to remove dependencies on the table that is to be modified. When you useSCHEMABINDING, the select_statement must include the two-part names (schema.object) of tables, views, oruser-defined functions that are referenced. All referenced objects must be in the same database.Views or tables that participate in a view created with the SCHEMABINDING clause cannot be dropped unlessthat view is dropped or changed so that it no longer has schema binding. Otherwise, the Database Engineraises an error. Also, executing ALTER TABLE statements on tables that participate in views that have schemabinding fail when these statements affect the view definition.

If the previous restrictions prevent you from modifying data directly through a view, consider the followingoptions:INSTEAD OF Triggers

Page 3: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

INSTEAD OF triggers can be created on a view to make a view updatable. The INSTEAD OF trigger isexecuted instead of the data modification statement on which the trigger is defined. This trigger lets the userspecify the set of actions that must happen to process the data modification statement. Therefore, if anINSTEAD OF trigger exists for a view on a specific data modification statement (INSERT, UPDATE, orDELETE), the corresponding view is updatable through that statement. For more information about INSTEADOF triggers, see DML Triggers.Partitioned ViewsIf the view is a partitioned view, the view is updatable, subject to certain restrictions. When it is needed, theDatabase Engine distinguishes local partitioned views as the views in which all participating tables and the vieware on the same instance of SQL Server, and distributed partitioned views as the views in which at least one ofthe tables in the view resides on a different or remote server.

Conditions for Modifying Data in Partitioned ViewsThe following restrictions apply to statements that modify data in partitioned views:The INSERT statement must supply values for all the columns in the view, even if the underlying membertables have a DEFAULT constraint for those columns or if they allow for null values. For those member tablecolumns that have DEFAULT definitions, the statements cannot explicitly use the keyword DEFAULT.The value being inserted into the partitioning column should satisfy at least one of the underlying constraints;otherwise, the insert action will fail with a constraint violation.UPDATE statements cannot specify the DEFAULT keyword as a value in the SET clause, even if the columnhas a DEFAULT value defined in the corresponding member table.Columns in the view that are an identity column in one or more of the member tables cannot be modified byusing an INSERT or UPDATE statement.If one of the member tables contains a timestamp column, the data cannot be modified by using an INSERT orUPDATE statement.If one of the member tables contains a trigger or an ON UPDATE CASCADE/SET NULL/SET DEFAULT or ONDELETE CASCADE/SET NULL/SET DEFAULT constraint, the view cannot be modified.INSERT, UPDATE, and DELETE actions against a partitioned view are not allowed if there is a self-join with thesame view or with any of the member tables in the statement.Bulk importing data into a partitioned view is unsupported by bcp or the BULK INSERT and INSERT ... SELECT* FROM OPENROWSET(BULK...) statements. However, you can insert multiple rows into a partitioned view byusing the INSERT statement.NoteTo update a partitioned view, the user must have INSERT, UPDATE, and DELETE permissions on the membertables.

QUESTION 2You 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 theview returns the correct results. Which code segment should you run?

A. EXEC sp_refreshview @viewname = 'dbo.View1';

B. ALTER dbo.View1 WITH SCHEMABINDING, VIEW_METADATAASSELECT t1.col1, t1.col2, t2.*FROM dbo.Table1 AS t1 JOIN dbo.Table2 AS t2ON t1.col1 = t2.col2;

C. DROP dbo.View1;GO

Page 4: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

CREATE dbo.View1 WITH SCHEMABINDING, VIEW_METADATAAS SELECT t1.col1, t1.col2, t2.*FROM dbo.Table1 AS t1 JOIN dbo.Table2 AS t2ON t1.col1 = t2.col2;

D. EXEC sp_refreshsqlmodule @name = 'dbo.Table2';

Correct Answer: ASection: (none)Explanation

Explanation/Reference:References:http://msdn.microsoft.com/en-us/library/ms173846.aspxhttp://msdn.microsoft.com/en-us/library/ms187956.aspxhttp://msdn.microsoft.com/en-us/library/ms187821.aspxhttp://msdn.microsoft.com/en-us/library/bb326754.aspx

sp_refreshviewIf a view is not created with schemabinding, sp_refreshview should be run when changes are made to theobjects underlying the view that affect the definition of the view. Otherwise, the view might produce unexpectedresults when it is queried.

sp_refreshsqlmoduleUpdates the metadata for the specified non-schema-bound stored procedure, user-defined function, view, DMLtrigger, database-level DDL trigger, or server-level DDL trigger in the current database. Persistent metadata forthese objects, such as data types of parameters, can become outdated because of changes to their underlyingobjects.

sp_refreshsqlmodule should be run when changes are made to the objects underlying the module that affect itsdefinition. Otherwise, the module might produce unexpected results when it is queried or invoked. To refresh aview, you can use either sp_refreshsqlmodule or sp_refreshview with the same results.

ALTER ViewModifies a previously created view. This includes an indexed view. ALTER VIEW does not affect dependentstored procedures or triggers and does not change permissions.

SCHEMABINDINGBinds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the basetables cannot be modified in a way that would affect the view definition. The view definition itself must first bemodified or dropped to remove dependencies on the table to be modified. When you use SCHEMABINDING,the select_statement must include the two-part names (schema.object) of tables, views, or user-definedfunctions that are referenced. All referenced objects must be in the same database.Views or tables that participate in a view created with the SCHEMABINDING clause cannot be dropped, unlessthat view is dropped or changed so that it no longer has schema binding. Otherwise, the Database Engineraises an error. Also, executing ALTER TABLE statements on tables that participate in views that have schemabinding fail if these statements affect the view definition.VIEW_METADATASpecifies that the instance of SQL Server will return to the DB-Library, ODBC, and OLE DB APIs the metadatainformation about the view, instead of the base table or tables, when browse-mode metadata is beingrequested for a query that references the view. Browse-mode metadata is additional metadata that the instanceof Database Engine returns to the client-side DB-Library, ODBC, and OLE DB APIs. This metadata enables theclient-side APIs to implement updatable client-side cursors. Browse-mode metadata includes information aboutthe base table that the columns in the result set belong to.For views created with VIEW_METADATA, the browse-mode metadata returns the view name and not thebase table names when it describes columns from the view in the result set.When a view is created by using WITH VIEW_METADATA, all its columns, except a timestamp column, areupdatable if the view has INSERT or UPDATE INSTEAD OF triggers. For more information, see the Remarkssection in CREATE VIEW (Transact-SQL).

Page 5: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

QUESTION 3You are creating a table named Orders. You need to ensure that every time a new row is added to the Orderstable, a user-defined function is called to validate the row before the row is added to the table. What should youuse? More than one answer choice may achieve the goal. Select the BEST answer.

A. a Data Definition Language (DDL) triggerB. a data manipulation language (DML) triggerC. a DEFAULT constraintD. a FOREIGN KEY constraintE. a CHECK constraint

Correct Answer: ESection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

may want to be changed to dml trigger (B)

Reference:http://www.techrepublic.com/blog/programming-and-development/comparing-sql-server-constraints-and-dml-triggers/402http://msdn.microsoft.com/en-us/library/ms178110.aspx

QUESTION 4You have an index for a table in a SQL Azure database. The database is used for Online TransactionProcessing (OLTP). You discover that the index consumes more physical disk space than necessary. You needto minimize the amount of disk space that the index consumes. What should you set from the index options?

A. STATISTICS_NORECOMPUTE = OFFB. STATISTICS_NORECOMPUTE = ONC. FILLFACTOR = 0D. FILLFACTOR = 80

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Reference: http://msdn.microsoft.com/en-us/library/ms177459.aspxhttp://msdn.microsoft.com/en-us/library/ms188783.aspx

FILLFACTORThis topic describes what fill factor is and how to specify a fill factor value on an index in SQL Server 2012 byusing SQL Server Management Studio or Transact-SQL.The fill-factor option is provided for fine-tuning index data storage and performance. When an index is createdor rebuilt, the fill-factor value determines the percentage of space on each leaf-level page to be filled with data,reserving the remainder on each page as free space for future growth. For example, specifying a fill-factorvalue of 80 means that 20 percent of each leaf-level page will be left empty, providing space for indexexpansion as data is added to the underlying table. The empty space is reserved between the index rows ratherthan at the end of the index.

Page 6: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

The fill-factor value is a percentage from 1 to 100, and the server-wide default is 0 which means that theleaf-level pages are filled to capacity.Performance ConsiderationsPage SplitsA correctly chosen fill-factor value can reduce potential page splits by providing enough space for indexexpansion as data is added to the underlying table.When a new row is added to a full index page, the DatabaseEngine moves approximately half the rows to a new page to make room for the new row. This reorganization isknown as a page split. A page split makes room for new records, but can take time to perform and is aresource intensive operation. Also, it can cause fragmentation that causes increased I/O operations. Whenfrequent page splits occur, the index can be rebuilt by using a new or existing fill-factor value to redistribute thedata. For more information, see Reorganize and Rebuild Indexes.Although a low, nonzero fill-factor value may reduce the requirement to split pages as the index grows, theindex will require more storage space and can decrease read performance. Even for an application oriented formany insert and update operations, the number of database reads typically outnumber database writes by afactor of 5 to 10. Therefore, specifying a fill factor other than the default can decrease database readperformance by an amount inversely proportional to the fill-factor setting. For example, a fill-factor value of 50can cause database read performance to decrease by two times. Read performance is decreased because theindex contains more pages, therefore increasing the disk IO operations required to retrieve the data.Adding Data to the End of the TableA nonzero fill factor other than 0 or 100 can be good for performance if the new data is evenly distributedthroughout the table. However, if all the data is added to the end of the table, the empty space in the indexpages will not be filled. For example, if the index key column is an IDENTITY column, the key for new rows isalways increasing and the index rows are logically added to the end of the index. If existing rows will be updatedwith data that lengthens the size of the rows, use a fill factor of less than 100. The extra bytes on each page willhelp to minimize page splits caused by extra length in the rows.

STATISTICS_NORECOMPUTEQuestion: Recently I noticed an option with CREATE/ALTER INDEX called STATISTICS_NORECOMPUTE?I'm not sure I understand this option or why you'd ever want to use it? Can you explain?

Answer: In general, I don't recommend this option. But, before I get to why - let me clarify what the option does.I've heard a few folks say that it stops SQL Server from updating the statistics at the time of a rebuild; that isNOT what it does. Statistics are ALWAYS updated at the time of a REBUILD; this cannot be turned off (norwould you want to).

Instead, STATISTICS_NORECOMPUTE stops the database-wide auto-updating (auto update statistics) fromupdating the specific statistics for an index (or column-level statistic) that was created (or rebuilt) with thisoption turned on. NOTE: STATISTICS_RECOMPUTE only works when creating or rebuilding an index. If youwant to stop the auto-updating of a column-level statistic you use NORECOMPUTE when creating thatparticular statistic.

The more difficult question is if/when this would make sense to turn off – for either an index or a column-levelstatistic. And, yes, there are some cases where this can be appropriate.

The case where it makes sense to be turned off is for tables that are large in size and have very skewed datadistribution. For example, the ratio of line items per sale might be very evenly distributed between 1 and 3 itemswith an average of 2.1. Evenly distributed data tends to be easier to represent in a histogram (one of the piecesof information maintained in a statistic in SQL Server). However, sales per customer or sales per product mightbe much more uneven (and therefore skewed). And, when data distribution is skewed then then statistics arepotentially less accurate in a histogram. This is further exacerbated by the process that SQL Server maychoose of sampling your data. SQL Server will choose to sample your data (rather than reading every row)when the data they have to scan (ideally, an index but sometimes the table itself) is over 2,000 pages in size.

When would you know it’s a problem? If you run a query and you evaluate the estimated rows vs. the actual rows and the estimate seems significantlydifferent from the actual, then you might have a statistics problem. If you update statistics with the followingcode:

UPDATE STATISTICS tablename indexname (or statisticsname)

Page 7: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Then, try the query again. If this solved the problem, then you know that you’re not updating statistics enough. Ifit does not solve the problem then try updating the statistics will a fullscan:

UPDATE STATISTICS tablename indexname WITH FULLSCAN

If the estimate and actuals are more accurate (and typically result in better plans) then you might want to turnoff the auto-updating of the statistic and solely control this particular statistics update with a job that updates thestatistic with a full scan. The positive is that your statistics are likely to be more accurate and then your planswill be as well. The negative is that updating a statistic with a full scan can be a more costly maintenanceoperation. And, you have to be especially careful that your automated process doesn’t get removed or deletedleaving this statistic to never get auto-updated again.

In summary, I don’t often recommend STATISTICS_NORECOMPUTE on indexes (or NORECOMPUTE onstatistics) but there are cases when you might be able to better control the updating of statistics as well as allowfor a FULLSCAN. In these cases (and when you’re certain that your automated routines will not be interrupted/deleted/modified), then using this option can be beneficial!

QUESTION 5You run the following code:

You need to ensure that the root node of the XML data stored in the Details column is <Order_Details>. Whatshould you implement? More than one answer choice may achieve the goal. Select the BEST answer.

A. A user-defined data typeB. A Data Definition Language (DDL) triggerC. A data manipulation language (DML) triggerD. An XML schema collectionE. An XML index

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/ms187856.aspx

QUESTION 6Your 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 SELECTpermission on Table1 and Table2. You need to ensure that User1 can run sp1. The solution must minimize thenumber of permissions assigned to User1. What should you do?

Page 8: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to this reference, the answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/ms191291.aspx

whilst the owner of the stored proc and the table are the same, then it would be sufficient to grant execute onthe stored procedure to do the insert unless the stored proc contains dynamic sql

See Ownership Chains

When multiple database objects access each other sequentially, the sequence is known as a chain. Althoughsuch chains do not independently exist, when SQL Server traverses the links in a chain, SQL Server evaluatespermissions on the constituent objects differently than it would if it were accessing the objects separately.These differences have important implications for managing security.Ownership chaining enables managing access to multiple objects, such as multiple tables, by settingpermissions on one object, such as a view. Ownership chaining also offers a slight performance advantage inscenarios that allow for skipping permission checks.How Permissions Are Checked in a ChainWhen an object is accessed through a chain, SQL Server first compares the owner of the object to the owner ofthe calling object. This is the previous link in the chain. If both objects have the same owner, permissions onthe referenced object are not evaluated.Example of Ownership ChainingIn the following illustration, the July2003 view is owned by Mary. She has granted to Alex permissions on theview. He has no other permissions on database objects in this instance. What occurs when Alex selects theview?

Page 9: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

1. Alex executes SELECT * on the July2003 view. SQL Server checks permissions on the view and confirmsthat Alex has permission to select on it.

2. The July2003 view requires information from the SalesXZ view. SQL Server checks the ownership of theSalesXZ view. Because this view has the same owner (Mary) as the view that calls it, permissions onSalesXZ are not checked. The required information is returned.

3. The SalesXZ view requires information from the InvoicesXZ view. SQL Server checks the ownership of theInvoicesXZ view. Because this view has the same owner as the previous object, permissions on InvoicesXZare not checked. The required information is returned. To this point, all items in the sequence have had oneowner (Mary). This is known as an unbroken ownership chain.

4. The InvoicesXZ view requires information from the AcctAgeXZ view. SQL Server checks the ownership ofthe AcctAgeXZ view. Because the owner of this view differs from the owner of the previous object (Sam, notMary), full information about permissions on this view is retrieved. If the AcctAgeXZ view has permissionsthat enable access by Alex, information will be returned.

5. The AcctAgeXZ view requires information from the ExpenseXZ table. SQL Server checks the ownership ofthe ExpenseXZ table. Because the owner of this table differs from the owner of the previous object (Joe, notSam), full information about permissions on this table is retrieved. If the ExpenseXZ table has permissionsthat enable access by Alex, information is returned.

6. When the July2003 view tries to retrieve information from the ProjectionsXZ table, the server first checks tosee whether cross-database chaining is enabled between Database 1 and Database 2. If cross-databasechaining is enabled, the server will check the ownership of the ProjectionsXZ table. Because this table hasthe same owner as the calling view (Mary), permissions on this table are not checked. The requestedinformation is returned.

Cross-Database Ownership ChainingSQL Server can be configured to allow ownership chaining between specific databases or across all databasesinside a single instance of SQL Server. Cross-database ownership chaining is disabled by default, and shouldnot be enabled unless it is specifically required.Potential Threats

Page 10: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Ownership chaining is very useful in managing permissions on a database, but it does assume that objectowners anticipate the full consequences of every decision to grant permission on a securable. In the previousillustration, Mary owns most of the underlying objects of the July 2003 view. Because Mary has the right tomake objects that she owns accessible to any other user, SQL Server behaves as though whenever Marygrants access to the first view in a chain, she has made a conscious decision to share the views and table itreferences. In real life, this might not be a valid assumption. Production databases are far more complex thanthe one in the illustration, and the permissions that regulate access to them rarely map perfectly to theadministrative structures of the organizations that use them.

You should understand that members of highly privileged database roles can use cross-database ownershipchaining to access objects in databases external to their own. For example, if cross-database ownershipchaining is enabled between database A and database B, a member of the db_owner fixed database role ofeither database can spoof her way into the other database. The process is simple: Diane (a member ofdb_owner in database A) creates user Stuart in database A. Stuart already exists as a user in database B.Diane then creates an object (owned by Stuart) in database A that calls any object owned by Stuart in databaseB. Because the calling and called objects have a common owner, permissions on the object in database B willnot be checked when Diane accesses it through the object she has created.

QUESTION 7You are creating a database that will store usernames and passwords for an application. You need torecommend a solution to store the passwords in the database. What should you recommend? More than oneanswer choice may achieve the goal. Select the BEST answer.

http://www.gratisexam.com/

A. Encrypting File System (EFS)B. One-way encryptionC. Reversible encryptionD. Transparent Data Encryption (TDE)

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Reference:http://stackoverflow.com/questions/2329582/what-is-currently-the-most-secure-one-way-encryption-algorithmhttp://msdn.microsoft.com/en-us/library/ms179331.aspx

The concept of One way encryption is to encrypt the content and store it inside the database.If a person logs in with their authentication details the password would be encrypted and would be checkedagainst the encrypted value stored in the table. The hitch is if the user forgets their password it can't beretreived back. The only way out is the password needs to be reset.

Passwords should be hashed rather than encrypted as you simply need to check the hashes of a passwordrather than see what the password is.

Page 11: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Each order is tracked by using one of the following statuses:FulfilledShippedOrderedReceived

You need to design the database to ensure that you can retrieve the status of an order on a given date. Thesolution must ensure that new statuses can be added in the future. What should you do? More than one answerchoice 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 Statuscolumn 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.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms191178.aspxhttp://msdn.microsoft.com/en-us/library/cc645937.aspx

QUESTION 9You are troubleshooting an application that runs a query. The application frequently causes deadlocks. Youneed to identify which transaction causes the deadlock. What should you do? More than one answer choicemay 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.

Correct Answer: B

Page 12: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://www.sqlservercentral.com/blogs/james-sql-footprint/2012/08/12/monitor-deadlock-in-sql-2012/http://blogs.technet.com/b/mspfe/archive/2012/06/28/how_2d00_to_2d00_monitor_2d00_deadlocks_2d00_in_2d00_sql_2d00_server.aspxhttp://msdn.microsoft.com/en-us/library/ms177648.aspxhttp://msdn.microsoft.com/en-us/library/ms176013.aspxhttp://msdn.microsoft.com/en-us/library/ms188246.aspx

QUESTION 10You plan to create a database. The database will be used by a Microsoft .NET application for a special eventthat will last for two days. During the event, data must be highly available. After the event, the database will bedeleted. You need to recommend a solution to implement the database while minimizing costs. The solutionmust not affect any existing applications. What should you recommend? More than one answer choice mayachieve the goal. Select the BEST answer.

A. SQL Server 2012 EnterpriseB. SQL AzureC. SQL Server 2012 Express with Advanced ServicesD. SQL Server 2012 Standard

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:https://www.windowsazure.com/en-us/pricing/details/http://msdn.microsoft.com/en-us/library/windowsazure/ee336279.aspxhttp://msdn.microsoft.com/en-us/library/windowsazure/ee336241.aspxhttp://msdn.microsoft.com/en-us/library/windowsazure/ee336230.aspxhttp://msdn.microsoft.com/en-us/evalcenter/hh230763.aspxhttp://msdn.microsoft.com/en-us/library/hh510202.aspxhttp://msdn.microsoft.com/en-us/library/cc645993.aspx

QUESTION 11You have a server named Server1 that has 16 processors. You plan to deploy multiple instances of SQL Server2012 to Server1. You need to recommend a method to allocate processors to each instance. What should youinclude in the recommendation? More than one answer choice may achieve the goal. Select the BEST answer.

A. Max Degree of ParallelismB. Processor affinityC. Windows System Resource Manager (WSRM)D. Resource Governor

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

Page 13: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187104.aspxhttp://msdn.microsoft.com/en-us/library/ms188611.aspxhttp://msdn.microsoft.com/en-us/library/bb933866.aspx

Windows System Resource Manager will consider only the state of that single processor when calculating theresources available

Resource Governor ConstraintsThis release of Resource Governor has the following constraints:

Resource management is limited to the SQL Server Database Engine. Resource Governor can not be usedfor Analysis Services, Integration Services, and Reporting Services.There is no workload monitoring or workload management between SQL Server instances.Limit specification applies to CPU bandwidth and memory managed by SQL Server.OLTP workloads. Resource Governor can manage OLTP workloads but these types of queries, which aretypically very short in duration, are not always on the CPU long enough to apply bandwidth controls. Thismay skew in the statistics returned for CPU usage %.

QUESTION 12You have a SQL Azure database. You need to identify which keyword must be used to create a view that will beindexed. Which keyword should you identify?

A. DISTINCT

B. DEFAULT

C. SCHEMABINDING

D. VIEW_METADATA

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187956.aspxhttp://msdn.microsoft.com/en-us/library/ms191432.aspx

If you want to add indexes to a view you must make the view schema bound by adding the WITHSCHEMABINDING clause to the CREATE VIEW statement and you must specify the schema for each table s

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

Page 14: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to this reference, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187956.aspx

QUESTION 14You 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. Youneed to store validated XML data in Schema1.Table1. The solution must ensure that only valid XML data isaccepted by Param1. What should you do? (Each correct answer presents part of the solution. Choose all thatapply.)

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.

Correct Answer: BCDSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/bb510420.aspxhttp://msdn.microsoft.com/en-us/library/ms187856.aspxhttp://msdn.microsoft.com/en-us/library/ms176009.aspxhttp://msdn.microsoft.com/en-us/library/hh403385.aspxhttp://msdn.microsoft.com/en-us/library/ms184277.aspx

QUESTION 15You have an index for a table in a SQL Azure database. The database is used for Online TransactionProcessing (OLTP). You discover that many page splits occur when records are inserted or updated in thetable. You need to minimize the number of page splits. What should you set from the index options?

Page 15: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. FILLFACTOR = 0

B. STATISTICS_NORECOMPUTE = ON

C. STATISTICS_NORECOMPUTE = OFF

D. FILLFACTOR = 80

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188783.aspxhttp://msdn.microsoft.com/en-us/library/ms177459.aspx

QUESTION 16You 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. Youplan to deploy an application that will search Column2. You need to create an index on Table1 to support theplanned deployment. The solution must minimize the storage requirements. Which code segment should youexecute?

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

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188783.aspxhttp://msdn.microsoft.com/en-us/library/cc280372.aspx

QUESTION 17You are creating a table named Orders. You need to ensure that every time a new row is added to the Orderstable, a table that is used for auditing is updated. What should you use? More than one answer choice mayachieve the goal. Select the BEST answer.

Page 16: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. a DEFAULT constraintB. a Data Definition Language (DDL) triggerC. a CHECK constraintD. a FOREIGN KEY constraintE. a data manipulation language (DML) trigger

Correct Answer: ESection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://www.techrepublic.com/blog/programming-and-development/comparing-sql-server-constraints-and-dml-triggers/402http://msdn.microsoft.com/en-us/library/ms178110.aspx

QUESTION 18You have a database named database1. Database developers report that there are many deadlocks. You needto 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 templateB. an Extended Events sessionC. log errors by using trace flag 1204D. log errors by using trace flag 1222

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://www.sqlservercentral.com/blogs/james-sql-footprint/2012/08/12/monitor-deadlock-in-sql-2012/http://blogs.technet.com/b/mspfe/archive/2012/06/28/how_2d00_to_2d00_monitor_2d00_deadlocks_2d00_in_2d00_sql_2d00_server.aspx

QUESTION 19You execute the following code.

Page 17: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms179859.aspxhttp://msdn.microsoft.com/en-us/library/ms187748.aspx

QUESTION 20You have a SQL Server 2012 database named DB1. You have a backup device named Device1. You discoverthat the log file for the database is full. You need to ensure that DB1 can complete transactions. The solutionmust 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

Correct Answer: DSection: (none)Explanation

Page 18: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms186865.aspxhttp://msdn.microsoft.com/en-us/library/ms179478.aspxhttp://msdn.microsoft.com/en-us/library/ms190925.aspx

BACKUP LOG DB1 TO Device1One of the simplest ways to truncate the log is to perform a normal log backup:BACKUP LOG AdventureWorks TO DISK = 'c:\backups\advw20120317.trn'This will not break the LSN chain, and will effectively truncate the inactive portion of the log, IF a checkpoint hasbeen performed since the last log backup.Backing up the log in order to truncate it will not reduce the size of the physical log file, it will only clear inactivetransactions, thus preventing further unnecessary growth of the log file.

BACKUP LOG DB1 TO Device1 WITH COPY_ONLYSpecifies that the backup is a copy-only backup, which does not affect the normal sequence of backups. Acopy-only backup is created independently of your regularly scheduled, conventional backups. A copy-onlybackup does not affect your overall backup and restore procedures for the database.Copy-only backups were introduced in SQL Server 2005 for use in situations in which a backup is taken for aspecial purpose, such as backing up the log before an online file restore. Typically, a copy-only log backup isused once and then deleted.When used with BACKUP DATABASE, the COPY_ONLY option creates a full backup that cannot serve as adifferential base. The differential bitmap is not updated, and differential backups behave as if the copy-onlybackup does not exist. Subsequent differential backups use the most recent conventional full backup as theirbase.ImportantIf DIFFERENTIAL and COPY_ONLY are used together, COPY_ONLY is ignored, and a differential backup iscreated.When used with BACKUP LOG, the COPY_ONLY option creates a copy-only log backup, which does nottruncate the transaction log. The copy-only log backup has no effect on the log chain, and other log backupsbehave as if the copy-only backup does not exist.

BACKUP LOG DB1 TO Device1 WITH TRUNCATE_ONLYAn older method of truncating the log was to use BACKUP LOG WITH TRUNCATE_ONLY or BACKUP LOGWITH NO_LOG. These methods have been deprecated in SQL Server 2005, and were completely removedfrom SQL Server 2008 – and for good reason.

QUESTION 21You have a server that has SQL Server 2012 installed. You need to identify which parallel execution plans arerunning in serial. Which tool should you use?

A. Performance MonitorB. Database Engine Tuning AdvisorC. Extended EventsD. Data Profile Viewer

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Verified answer as correct.

References:http://msdn.microsoft.com/en-us/library/bb677278.aspxhttp://msdn.microsoft.com/en-us/library/bb630282.aspxhttp://www.sql-server-performance.com/2006/query-execution-plan-analysis/

Page 19: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://www.simple-talk.com/sql/learn-sql-server/understanding-and-using-parallelism-in-sql-server/http://www.sqlservercentral.com/articles/SQL+Server+2012/At+last%2c+execution+plans+show+true+thread+reservations./92458/http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-parallel-query-execution-plan.aspxhttp://sqlblog.com/blogs/paul_white/archive/2012/05/02/parallel-row-goals-gone-rogue.aspxhttp://msdn.microsoft.com/en-us/library/bb895310.aspxhttp://msdn.microsoft.com/en-us/library/bb895313.aspxhttp://msdn.microsoft.com/en-us/library/hh231122.aspx

QUESTION 22You are creating a table to support an application that will cache data outside of SQL Server. The applicationwill detect whether cached values were changed before it updates the values. You need to create the table, andthen 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')

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms182776.aspxhttp://msdn.microsoft.com/en-us/library/ms187942.aspxhttp://msdn.microsoft.com/en-us/library/ms190348.aspx

QUESTION 23You use SQL Server 2012 to maintain the data used by the applications at your company. You plan to create atable named Table1 by using the following statement. (Line numbers are included for reference only.)

Page 20: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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,

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms184391.aspxhttp://msdn.microsoft.com/en-us/library/ms143726.aspxhttp://msdn.microsoft.com/en-us/library/ff848763.aspx

QUESTION 24You are creating a database that will store usernames and credit card numbers for an application. You need torecommend a solution to store the credit card numbers in the database. What should you recommend? Morethan one answer choice may achieve the goal. Select the BEST answer.

A. One-way encryptionB. Reversible encryptionC. Encrypting File System (EFS)D. Transparent Data Encryption (TDE)

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

Page 21: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

References:http://technet.microsoft.com/en-us/library/hh994559(v=ws.10).aspxhttp://msdn.microsoft.com/en-us/library/bb964742.aspxhttp://msdn.microsoft.com/en-us/library/bb510663.aspx

QUESTION 25You 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 followingrequirements:

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 snapshotB. change data captureC. a data-tier applicationD. SQL Server Integration Services (SSIS)E. SQL Data Sync

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

thinks C

References:http://msdn.microsoft.com/en-us/library/windowsazure/ee336279.aspxhttp://msdn.microsoft.com/en-us/library/windowsazure/hh694043.aspxhttp://msdn.microsoft.com/en-us/library/hh456371.aspx

QUESTION 26You have a SQL Server 2012 database named Database1. Database1 has a data file nameddatabase1_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 logbackups in the future. Which code segment should you execute? To answer, move the appropriate codesegments from the list of code segments to the answer area and arrange them in the correct order.

Build List and Reorder:

Page 22: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://technet.microsoft.com/en-us/library/ms190757.aspxhttp://technet.microsoft.com/en-us/library/ms189493.aspxhttp://technet.microsoft.com/en-us/library/ms365418.aspxhttp://technet.microsoft.com/en-us/library/ms189272.aspxhttp://technet.microsoft.com/en-us/library/ms179478.aspx

QUESTION 27You have a database named DB1. You plan to create a stored procedure that will insert rows into three differenttables. Each insert must use the same identifying value for each table, but the value must increase from oneinvocation of the stored procedure to the next. Occasionally, the identifying value must be reset to its initialvalue. You need to design a mechanism to hold the identifying values for the stored procedure to use. Whatshould 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 thestored 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 thevalue by using the stored procedure. Reset the value as needed by using an UPDATE statement.

Page 23: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

C. Create a sequence object that holds the next value in the sequence. Retrieve the next value by using thestored procedure. Increment the sequence object to the next value by using an ALTER SEQUENCEstatement. 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 eachtable. Insert new rows into the tables by using the stored procedure. Use the DBCC CHECKIDENTcommand to reset the columns as needed.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ff878091.aspxhttp://msdn.microsoft.com/en-us/library/ms176057.aspxhttp://msdn.microsoft.com/en-us/library/ff878572.aspxhttp://msdn.microsoft.com/en-us/library/ff878058.aspx

QUESTION 28DRAG DROPYou plan to install two SQL Server 2012 environments named Environment1 and Environment2. Your companyidentifies 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 eachenvironment to ensure that all data remains available if a physical server fails. How many servers should youidentify? To answer, drag the appropriate number to the correct environment in the answer area.

Select and Place:

Correct Answer:

Page 24: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

May need to be 2, 2

References:http://msdn.microsoft.com/en-us/library/ms189852.aspxhttp://msdn.microsoft.com/en-us/library/hh510230.aspx

QUESTION 29DRAG DROPYou 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 thedatabase 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 processoroverhead. Which features should you identify? To answer, drag the appropriate feature to the correctrequirement in the answer area.

Select and Place:

Correct Answer:

Page 25: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/windows/desktop/aa364223.aspxhttp://msdn.microsoft.com/en-us/library/bb510667.aspxhttp://msdn.microsoft.com/en-us/library/bb879935.aspxhttp://msdn.microsoft.com/en-us/library/bb934049.aspxhttp://msdn.microsoft.com/en-us/library/windows/hardware/gg487306.aspxhttp://msdn.microsoft.com/en-us/library/ff773063.aspx

QUESTION 30DRAG DROPYou 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? Toanswer, drag the appropriate feature to the correct monitoring requirement in the answer area.

Select and Place:

Page 26: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188754.aspxhttp://msdn.microsoft.com/en-us/library/cc879320.aspxhttp://msdn.microsoft.com/en-us/library/hh212951.aspx

Page 27: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/bb933866.aspxhttp://msdn.microsoft.com/en-us/library/hh245121.aspx

QUESTION 31You have a table named Table1 that contains 1 million rows. Table1 contains a column named Column1 thatstores 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 codesegment should you execute before you remove Column1? To answer, move the appropriate code segmentsfrom the list of code segments to the answer area and arrange them in the correct order.

Build List and Reorder:

Correct Answer:

Section: (none)Explanation

Page 28: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Explanation/Reference:According to these references, the answer looks correct.

References:http://www.databasejournal.com/features/mssql/article.php/3922881/Column-Level-Encryption-in-SQL-Server.htmhttp://msdn.microsoft.com/en-us/library/bb510663.aspxhttp://msdn.microsoft.com/en-us/library/ms179331.aspxhttp://msdn.microsoft.com/en-us/library/ms175491.aspxhttp://msdn.microsoft.com/en-us/library/ms181860.aspxhttp://msdn.microsoft.com/en-us/library/ms174361.aspxhttp://msdn.microsoft.com/en-us/library/ms190499.aspxhttp://msdn.microsoft.com/en-us/library/ms177938.aspxhttp://msdn.microsoft.com/en-us/library/ms345262.aspxhttp://msdn.microsoft.com/en-us/library/ms188357.aspxhttp://msdn.microsoft.com/en-us/library/ms175491.aspx

QUESTION 32DRAG DROPYou 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 tomove the table to another schema named Schema2. What should you create? To answer, drag the appropriatecode segments to the correct location in the answer area.

Build List and Reorder:

Correct Answer:

Section: (none)Explanation

Explanation/Reference:

Page 29: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

According to these references, the answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/ms173423.aspx

QUESTION 33DRAG DROPYou plan to deploy SQL Server 2012. Your company identifies the following monitoring requirements for thedatabase:

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? Toanswer, drag the appropriate feature to the correct monitoring requirement in the answer area.

Select and Place:

Correct Answer:

Page 30: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/bb510667.aspxhttp://msdn.microsoft.com/en-us/library/ms180982.aspxhttp://msdn.microsoft.com/en-us/library/ms141026.aspxhttp://msdn.microsoft.com/en-us/library/ms188396.aspx

QUESTION 34DRAG DROPYou are designing two stored procedures named Procedure1 and Procedure2. You identify the followingrequirements:

Procedure1 must take a parameter that ensures that multiple rows of data can pass into the storedprocedure.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 youidentify? 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:

Page 31: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms131102.aspxhttp://msdn.microsoft.com/en-us/library/bb522446.aspxhttp://msdn.microsoft.com/en-us/library/bb510489.aspx

QUESTION 35DRAG DROPYou plan to deploy SQL Server 2012. You must create two tables named Table1 and Table2 that will have thefollowing specifications:

Table1 will contain a date column named Column1 that will contain a null value approximately 80 percent ofthe 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.

http://www.gratisexam.com/

Page 32: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

You need to recommend which options must be defined for the columns. The solution must minimize thestorage requirements for the tables. Which options should you recommend? To answer, drag the appropriateoptions to the correct column in the answer area.

Select and Place:

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/cc280604.aspxhttp://msdn.microsoft.com/en-us/library/ms186241.aspx

QUESTION 36DRAG DROPYou are designing a database for a university. The database will contain two tables named Classes andStudentGrades 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 technologiesshould you identify? To answer, drag the appropriate technology to the correct table in the answer area.

Page 33: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Select and Place:

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/gg471497.aspxhttp://msdn.microsoft.com/en-us/library/ff929144.aspxhttp://msdn.microsoft.com/en-us/library/ms189563.aspxhttp://msdn.microsoft.com/en-us/library/ms190174.aspxhttp://msdn.microsoft.com/en-us/library/ms187956.aspx

QUESTION 37DRAG DROPYou 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:

Page 34: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Select and Place:

Correct Answer:

Page 35: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Section: (none)Explanation

Explanation/Reference:According to this reference, the answer looks correct.

Reference:http://msdn.microsoft.com/en-US/library/ms187752.aspx

QUESTION 38DRAG DROPYou are designing an authentication strategy for a new server that has SQL Server 2012 installed. The strategymust 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 theamount of events that are logged. Which technologies should you recommend? To answer, drag theappropriate solution to the correct business requirement in the answer area.

Select and Place:

Page 36: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms175850.aspxhttp://msdn.microsoft.com/en-us/library/bb326598.aspxhttp://msdn.microsoft.com/en-us/library/ms187634.aspx

Page 37: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/bb510667.aspx

QUESTION 39You 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. Whatshould 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;GOCREATE INDEX IX_Sales_OrderDate ON Sales(OrderDate) ;GO

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

Thinks B

Page 38: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Reference:http://www.c-sharpcorner.com/UploadFile/skumaar_mca/good-practices-to-write-the-stored-procedures-in-sql-server/

QUESTION 40You plan to design an application that temporarily stores data in a SQL Azure database. You need to identifywhich types of database objects can be used to store data for the application. The solution must ensure that theapplication can make changes to the schema of a temporary object during a session. Which type of objectsshould you identify?

A. Common table expressions (CTEs)B. Temporary tablesC. Table variablesD. Temporary stored procedures

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms175972.aspxhttp://msdn.microsoft.com/en-us/library/ms189084.aspxhttp://msdn.microsoft.com/en-us/library/ms175010.aspxhttp://msdn.microsoft.com/en-us/library/bb510489.aspxhttp://msdn.microsoft.com/en-us/library/ms187926.aspxhttp://zacksfiasco.com/post/2010/01/21/SQL-Server-Temporary-Stored-Procedures.aspx

Page 39: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Exam B

QUESTION 1Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

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

Application RequirementsThe 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 Invoicetable.To protect against the theft of backup disks, invoice data must be protected by using the highest level ofencryption.The solution must provide a table-valued function that provides users with the ability to filter invoices bycustomer.Indexes must be optimized periodically based on their fragmentation by using the minimum amount ofadministrative effort.

Page 40: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Usp_InsertInvoices.sql

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

InvoicesByCustomer.sql

Page 41: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Legacy.sql

CountryFromID.sql

IndexManagement.sql

Page 42: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify the function in CountryFromID.sql to ensure that the country name is returned instead ofthe country ID. Which line of code should you modify in CountryFromID.sql?

A. 404B. 06C. 19D. 05

Correct Answer: CSection: (none)

Page 43: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms186755.aspxhttp://msdn.microsoft.com/en-us/library/ms191320.aspx

QUESTION 2Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

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

Application RequirementsThe 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

Page 44: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Usp_InsertInvoices.sql

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

Page 45: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

InvoicesByCustomer.sql

Legacy.sql

CountryFromID.sql

Page 46: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

IndexManagement.sql

Page 47: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionWhich data type should you use for CustomerlD?

A. varchar(11)B. bigintC. nvarchar(11)D. char(11)

Correct Answer: DSection: (none)Explanation

Page 48: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Explanation/Reference:According to these references, this answer looks correct.

Thinks D

References:http://msdn.microsoft.com/en-us/library/ms176089.aspxhttp://msdn.microsoft.com/en-us/library/ms187745.aspx

QUESTION 3Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

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

Application RequirementsThe 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.

Page 49: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 Invoicetable.To protect against the theft of backup disks, invoice data must be protected by using the highest level ofencryption.The solution must provide a table-valued function that provides users with the ability to filter invoices bycustomer.Indexes must be optimized periodically based on their fragmentation by using the minimum amount ofadministrative effort.

Usp_InsertInvoices.sql

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

Page 50: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

InvoicesByCustomer.sql

Legacy.sql

CountryFromID.sql

Page 51: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

IndexManagement.sql

Page 52: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify InsertInvoice to comply with the application requirements. Which code segment should youexecute?

A. OPEN CERT1;ALTER PROCEDURE InsertInvoice WITH ENCRYPTION;CLOSE CERT1;

B. ADD SIGNATURE TO InsertInvoice BY CERTIFICATE CERT2;

Page 53: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

C. OPEN CERT2;ALTER PROCEDURE InsertInvoice WITH ENCRYPTION;CLOSE CERT2;

D. ADD SIGNATURE TO InsertInvoice BY CERTIFICATE CERT1;

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/bb669102.aspx

QUESTION 4Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

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

Application Requirements

Page 54: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 Invoicetable.To protect against the theft of backup disks, invoice data must be protected by using the highest level ofencryption.The solution must provide a table-valued function that provides users with the ability to filter invoices bycustomer.Indexes must be optimized periodically based on their fragmentation by using the minimum amount ofadministrative effort.

Usp_InsertInvoices.sql

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

Page 55: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

InvoicesByCustomer.sql

Legacy.sql

CountryFromID.sql

Page 56: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

IndexManagement.sql

Page 57: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to convert the functionality of Legacy.sql to use a stored procedure. Which code segment should thestored 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),

Page 58: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187926.aspxhttp://msdn.microsoft.com/en-us/library/ms190782.aspxhttp://msdn.microsoft.com/en-us/library/bb669091.aspxhttp://msdn.microsoft.com/en-us/library/windows/desktop/ms709342.aspxhttp://msdn.microsoft.com/en-us/library/ms188001.aspx

QUESTION 5Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

Page 59: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Application RequirementsThe 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 Invoicetable.To protect against the theft of backup disks, invoice data must be protected by using the highest level ofencryption.The solution must provide a table-valued function that provides users with the ability to filter invoices bycustomer.Indexes must be optimized periodically based on their fragmentation by using the minimum amount ofadministrative effort.

Usp_InsertInvoices.sql

Page 60: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

InvoicesByCustomer.sql

Page 61: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Legacy.sql

CountryFromID.sql

IndexManagement.sql

Page 62: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to build a stored procedure that amortizes the invoice amount. Which code segment should you useto create the stored procedure? To answer, move the appropriate code segments from the list of codesegments to the answer area and arrange them in the correct order.

Build List and Reorder:

Page 63: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms131089.aspxhttp://msdn.microsoft.com/en-us/library/ms131048.aspxhttp://msdn.microsoft.com/en-us/library/ms187926.aspx

Page 64: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Exam C

QUESTION 1Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the databaseadministrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic showsthe 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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lost

Page 65: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

accidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a solution for the planned changes to the customer classifications. What should yourecommend? (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.

Correct Answer: ACSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/cc645937.aspx

QUESTION 2Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

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

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

Page 66: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

The Inventory database is used mainly for reports. The database is recreated every day. A full backup of thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a change to sp3 to ensure that the procedure completes only if all of the UPDATEstatements complete. Which change should you recommend?

A. Set the IMPLICIT_TRANSACTIONS option to off.B. Set the XACT_ABORT option to offC. Set the IMPLICIT_TRANSACTIONS option to on.D. Set the XACT_ABORT option to on.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:

Page 67: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/ms188792.aspxhttp://msdn.microsoft.com/en-us/library/ms188317.aspxhttp://msdn.microsoft.com/en-us/library/ms187807.aspx

QUESTION 3Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the databaseadministrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic showsthe 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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData Recovery

Page 68: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou 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 loginB. a database roleC. a credentialD. a server role

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Thinks B

References:http://msdn.microsoft.com/en-us/library/ms188659.aspxhttp://msdn.microsoft.com/en-us/library/ms189121.aspxhttp://msdn.microsoft.com/en-us/library/ms161950.aspxhttp://msdn.microsoft.com/en-us/library/ms188642.aspxhttp://msdn.microsoft.com/en-us/library/aa337562.aspx

QUESTION 4Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

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

Page 69: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a solution to minimize the amount of time it takes to execute sp1. With what shouldyou recommend replacing Table1?

A. a temporary table

Page 70: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

B. a functionC. a viewD. a table variable

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms175503.aspxhttp://msdn.microsoft.com/en-us/library/ms190174.aspx

QUESTION 5Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the databaseadministrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic showsthe 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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedure

Page 71: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

named sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a disaster recovery strategy for the Inventory database. What should you include inthe recommendation?

A. Log shippingB. AlwaysOn Availability GroupsC. SQL Server Failover ClusteringD. Peer-to-peer replication

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/cc645993.aspxhttp://msdn.microsoft.com/en-us/library/ms187103.aspxhttp://msdn.microsoft.com/en-us/library/ms190640.aspx

QUESTION 6Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the databaseadministrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic shows

Page 72: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a solution to ensure that sp4 adheres to the security requirements. What should youinclude in the recommendation?

Page 73: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. Configure data manipulation language (DML) triggers.B. Enable SQL Server Audit.C. Enable trace flags.D. Enable C2 audit tracing.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms178110.aspxhttp://msdn.microsoft.com/en-us/library/cc280386.aspxhttp://msdn.microsoft.com/en-us/library/ms188396.aspxhttp://msdn.microsoft.com/en-us/library/ms187634.aspx

QUESTION 7Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the databaseadministrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic showsthe 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 thedatabase currently takes three hours to complete.

Stored Procedures

Page 74: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a change to sp3 to ensure that the procedure continues to execute even if one of theUPDATE 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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188792.aspxhttp://msdn.microsoft.com/en-us/library/ms188317.aspxhttp://msdn.microsoft.com/en-us/library/ms187807.aspx

Page 75: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Exam D

QUESTION 1Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERPapplication. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts 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 namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

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

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

Page 76: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

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

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend a solution that addresses the concurrency requirement. What should yourecommend?

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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:

Page 77: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms191242%28v=SQL.105%29.aspxhttp://msdn.microsoft.com/en-us/library/bb677357.aspxhttp://msdn.microsoft.com/en-us/library/ms378149.aspx

QUESTION 2Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERPapplication. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts 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 namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

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

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Page 78: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

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

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

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

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend a solution that addresses the backup issue. The solution must minimize the amount ofdevelopment effort. What should you include in the recommendation?

A. filegroupsB. indexed viewsC. table partitioningD. indexes

Correct Answer: A

Page 79: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Section: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187048.aspxhttp://msdn.microsoft.com/en-us/library/ms189563.aspxhttp://msdn.microsoft.com/en-us/library/ms190174.aspxhttp://msdn.microsoft.com/en-us/library/ms190787.aspxhttp://msdn.microsoft.com/en-us/library/ms175049.aspx

QUESTION 3Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERPapplication. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts 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 namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

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

Page 80: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

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

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

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

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend a solution that addresses the index fragmentation and index width issue. What shouldyou 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.

Page 81: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.

Correct Answer: BCDSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://technet.microsoft.com/en-us/library/ms190639.aspxhttp://msdn.microsoft.com/en-us/library/ms190457.aspxhttp://msdn.microsoft.com/en-us/library/ms186342.aspxhttp://msdn.microsoft.com/en-us/library/ms189280.aspxhttp://stackoverflow.com/questions/255569/sql-data-type-for-primary-key-sql-serverhttp://sqlservernet.blogspot.com/2012/01/which-data-type-is-good-for-primary-key.htmlhttp://msdn.microsoft.com/en-us/library/jj591574.aspxhttp://www.informit.com/articles/article.aspx?p=25862&seqNum=5

QUESTION 4Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERPapplication. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts 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 namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

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

Page 82: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

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

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

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

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

Page 83: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend a solution that meets the data recovery requirement. What should you include in therecommendation?

A. a differential backupB. snapshot isolationC. a transaction log backupD. a database snapshot

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms175158.aspxhttp://msdn.microsoft.com/en-us/library/ms378149.aspxhttp://msdn.microsoft.com/en-us/library/ms187048.aspx

QUESTION 5Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERPapplication. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts 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 namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

Page 84: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

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

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

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

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Page 85: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend changes to the ERP application to resolve the search issue. The solution mustminimize the impact on other queries generated from the ERP application. What should you recommendchanging?

A. the data type of the ProductName columnB. the collation of the Products tableC. the collation of the ProductName columnD. the index on the ProductName column

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ff848763.aspxhttp://msdn.microsoft.com/en-us/library/ms143726.aspxhttp://msdn.microsoft.com/en-us/library/ms190920.aspx

Page 86: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Exam E

QUESTION 1Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend an isolation level for usp_UpdateOrderDetails. Which isolation level shouldrecommend?

A. repeatable readB. serializableC. read uncommittedD. read committed

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Page 87: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

References:http://msdn.microsoft.com/en-us/library/ms378149.aspxhttp://msdn.microsoft.com/en-us/library/ms173763.aspx

QUESTION 2Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a solution for Application1 that meets the security requirements. What should youinclude in the recommendation?

A. Encrypted columnsB. Certificate AuthenticationC. Signed stored proceduresD. Secure Socket Layer (SSL)

Correct Answer: ASection: (none)Explanation

Explanation/Reference:

Page 88: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms179331.aspx

QUESTION 3Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a solution to improve the performance of usp_UpdateInventory. The solution mustminimize the amount of development effort. What should you include in the recommendation?

A. a table variableB. a subqueryC. a common table expressionD. a cursor

Correct Answer: CSection: (none)Explanation

Page 89: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Explanation/Reference:

QUESTION 4Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a disk monitoring solution that meets the business requirements. What should youinclude in the recommendation?

A. a maintenance planB. a SQL Server Agent alertC. an auditD. a dynamic management view

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Page 90: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

References:http://msdn.microsoft.com/en-us/library/ms188754.aspxhttp://msdn.microsoft.com/en-us/library/cc280386.aspxhttp://msdn.microsoft.com/en-us/library/ms180982.aspxhttp://msdn.microsoft.com/en-us/library/ms187658.aspx

QUESTION 5Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a solution to allow application users to perform UPDATE operations on the databasetables. 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.

Correct Answer: BSection: (none)

Page 91: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188354.aspxhttp://msdn.microsoft.com/en-us/library/ms189121.aspxhttp://msdn.microsoft.com/en-us/library/ms131287.aspxhttp://msdn.microsoft.com/en-us/library/ms186755.aspxhttp://msdn.microsoft.com/en-us/library/ms191320.aspxhttp://msdn.microsoft.com/en-us/library/bb510667.aspx

QUESTION 6Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a solution for the deployment of SQL Server 2012. The solution must meet thebusiness requirements. What should you include in the recommendation?

A. Deploy two servers that have SQL Server 2012 installed. Implement AlwaysOn Availability Groups on bothservers.

Page 92: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

B. Upgrade the existing SQL Server 2005 instance to SQL Server 2012. Deploy a new server that has SQLServer 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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/bb677622.aspxhttp://msdn.microsoft.com/en-us/library/ff877884.aspx

QUESTION 7Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------Question

Page 93: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

You need to recommend a solution to synchronize Database2 to App1_Db1. What should you recommend?

A. Change data captureB. Snapshot replicationC. Transactional replicationD. Master Data Services

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ee633752.aspxhttp://msdn.microsoft.com/en-us/library/ms151198.aspxhttp://msdn.microsoft.com/en-us/library/cc645937.aspx

Page 94: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Exam F

QUESTION 1Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 95: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 96: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to provide referential integrity between the Offices table and Employees table. Which code segmentor 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 CONSTRAINTFK_Offices_Employees FOREIGN KEY (EmployeeID)REFERENCES dbo.Employees (EmployeeID);

B. ALTER TABLE dbo.Offices ADD CONSTRAINTPK_Offices_EmployeeID PRIMARY KEY (EmployeeID);

C. ALTER TABLE dbo.Employees ADD CONSTRAINTPK_Employees_EmployeeID PRIMARY KEY (EmployeeID);

D. ALTER TABLE dbo.Employees ADD CONSTRAINTFK_Employees_Offices FOREIGN KEY (OfficeID)REFERENCES dbo.Offices (OfficeID);

Correct Answer: ACSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Page 97: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

References:http://msdn.microsoft.com/en-us/library/ms189049.aspx

QUESTION 2Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 98: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 99: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou execute usp_SelectEmployeesByName multiple times, passing strings of varying lengths to @LastName.You discover that usp_SelectEmployeesByName uses inefficient execution plans. You need to updateusp_SelectEmployeesByName to ensure that the most efficient execution plan is used. What should you add atline 31 of StoredProcedures.sql?

A. OPTION (ROBUST PLAN)

B. OPTION (OPTIMIZE FOR UNKNOWN)

C. OPTION (KEEP PLAN)

D. OPTION (KEEPFIXED PLAN)

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms181714.aspx

QUESTION 3

Page 100: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 101: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 102: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to create the object used by the parameter of usp_UpdateEmployeeName. Which code segmentshould you use?

A. CREATE XML SCHEMA COLLECTION EmployeesInfo

B. CREATE TYPE EmployeesInfo AS Table

C. CREATE TABLE EmployeesInfo

D. CREATE SCHEMA EmployeesInfo

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms175010.aspxhttp://msdn.microsoft.com/en-us/library/ms174979.aspxhttp://msdn.microsoft.com/en-us/library/ms189462.aspxhttp://msdn.microsoft.com/en-us/library/ms176009.aspx

Page 103: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

QUESTION 4Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 104: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 105: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to add a new column named Confirmed to the Employees table. The solution must meet the followingrequirements:

Have a default value of TRUE.Minimize the amount of disk space used.

Which code segment should you use?

A. ALTER TABLE EmployeesADD Confirmed bit DEFAULT 0;

B. ALTER TABLE EmployeesADD Confirmed char(1) DEFAULT "1";

C. ALTER TABLE EmployeesADD Confirmed char(1) DEFAULT '0';

D. ALTER TABLE EmployeesADD Confirmed bit DEFAULT 1;

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Page 106: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

References:http://msdn.microsoft.com/en-us/library/ms177603.aspxhttp://msdn.microsoft.com/en-us/library/ms176089.aspx

QUESTION 5Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 107: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 108: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 109: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify usp_SelectEmployeesByName to support server-side paging. The solution must minimizethe amount of development effort required. What should you add to usp_SelectEmployeesByName?

A. an OFFSET-FETCH clauseB. a recursive common table expressionC. a table variableD. the ROWNUMBER keyword

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://www.mssqltips.com/sqlservertip/2696/comparing-performance-for-different-sql-server-paging-methods/http://msdn.microsoft.com/en-us/library/ms188385.aspxhttp://msdn.microsoft.com/en-us/library/ms180152.aspxhttp://msdn.microsoft.com/en-us/library/ms186243.aspxhttp://msdn.microsoft.com/en-us/library/ms186734.aspx

Page 110: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://www.sqlserver-training.com/how-to-use-offset-fetch-option-in-sql-server-order-by-clause/-http://www.sqlservercentral.com/blogs/juggling_with_sql/2011/11/30/using-offset-and-fetch/

Page 111: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Exam G

QUESTION 1Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe 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

Page 112: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Product.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Dynamic.sql

Page 113: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

CategoryFromType.sql

IndexManagement.sql

Page 114: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify Production.ProductDetails_Insert to comply with the application requirements.Which code segment should you execute?

A. ADD SIGNATURE TO Production.ProductDetails_InsertBY CERTIFICATE PRODUCTSCERT;

B. OPEN DBCERT;ALTER PROCEDURE Production. ProductDetails_InsertWITH ENCRYPTION;CLOSE D3CERT;

C. ADD SIGNATURE TO Production.ProductDetails_InsertBY CERTIFICATE DBCERT;

Page 115: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

D. OPEN PRODUCTSCERT;ALTER PROCEDURE Production. ProductDetails_InsertWITH ENCRYPTION;CLOSE PRODUCTSCERT;

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/bb669102.aspx

QUESTION 2Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe 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.

Page 116: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Page 117: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Dynamic.sql

CategoryFromType.sql

IndexManagement.sql

Page 118: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to create a function that will use a SELECT statement in ProductsByProductType.sql. Which codesegment should you use to complete the function?

A. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))RETURNS @tblInvoices TABLE (ProductID bigint, Produ ctType varchar(11),CreationDate date)AS

B. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))RETURNS xmlAS RETURN

Page 119: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

C. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))RETURNS @tblInvoices TABLE (ProductID bigint, Produ ctType varchar(11),CreationDate date)AS INSERT INTO @tblInvoices

D. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))RETURNS TABLEAS RETURN

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms191320.aspxhttp://msdn.microsoft.com/en-us/library/ms186755.aspx

QUESTION 3Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe planned database has the following requirements:

All stored procedures must be signed.The amount of disk space must be minimized.

Page 120: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Page 121: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Dynamic.sql

CategoryFromType.sql

IndexManagement.sql

Page 122: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou are planning the ManufacturingSteps table. You need to define the ProductID column in the CREATETABLE statement. Which code segment should you use?

A. ProductID bigint FOREIGN KEY REFERENCESProduction.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 K EY REFERENCES

Page 123: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Production.Product(ProductID),

D. ProductID bigint DEFAULT((NEXT VALUE FOR Production.ProductID_Seq OVER(ORDER BY ManufacturingStepID))) NOT NULL,

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms189049.aspxhttp://msdn.microsoft.com/en-us/library/ms179610.aspxhttp://msdn.microsoft.com/en-us/library/ff878370.aspx

QUESTION 4Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe 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.

Page 124: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Page 125: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Dynamic.sql

CategoryFromType.sql

IndexManagement.sql

Page 126: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to prepare the database to use the .NET Framework ProcessProducts component. Which codesegments should you execute? (Each correct answer presents part of the solution. Choose all that apply.)

A. CREATE ASSEMBLY ProductionAssembly FROM 'C:\Product s\ProcessProducts.DLL';

B. EXEC sp_recompile @objname = 'Production.ProcessPro duct';

C. RECONFIGURE;

D. EXEC sp_configure 'clr enabled', '1';

E. CREATE ASSEMBLY ProductionAssembly FROM 'C:\Product s\ProcessProducts.cs';

F. CREATE PROCEDURE Production.ProcessProduct( @ProductID int, @ProductType varchar(11)

Page 127: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

) AS EXTERNAL NAME ProductionAssembly.ProcessProduct .Process;

G. CREATE TYPE Production.ProcessProductEXTERNAL NAME ProductionAssembly.ProcessProducts.Pr ocess;

Correct Answer: ACDGSection: (none)Explanation

Explanation/Reference:According to the reference, this answer looks correct.

someone thinks a, c, d, f

Reference: http://msdn.microsoft.com/en-us/library/ms131048.aspxhttp://msdn.microsoft.com/en-us/library/ms131052.aspxhttp://msdn.microsoft.com/en-us/library/ms189524.aspxhttp://msdn.microsoft.com/en-us/library/ms345106.aspxhttp://msdn.microsoft.com/en-us/library/ms131107.aspx

QUESTION 5Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe planned database has the following requirements:

All stored procedures must be signed.The amount of disk space must be minimized.

Page 128: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Page 129: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Dynamic.sql

CategoryFromType.sql

IndexManagement.sql

Page 130: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to implement Transparent Data Encryption (TDE) on ProductsDB. Which code segment should youuse?

A. USE PRODUCTSDB;GOCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = TRIPLE_DES_3KEYENCRYPTION BY SERVER CERTIFICATE DBCERT;GOALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;GO

B. USE PRODUCTSDB;

Page 131: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

GOCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = TRIPLE_DES_3KEYENCRYPTION BY SERVER CERTIFICATE PRODUCTSCERT;GOALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;GO

C. USE PRODUCTSDB;GOCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256ENCRYPTION BY SERVER CERTIFICATE PRODUCTSCERT;GOALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;GO

D. USE PRODUCTSDB;GOCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256ENCRYPTION BY SERVER CERTIFICATE DBCERT;GOALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;GO

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/bb934049.aspx

Page 132: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Exam H

QUESTION 1Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 133: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 134: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 135: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 136: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to provide referential integrity between the Sessions table and Speakers table. Which code segmentshould you add at line 47 of Tables.sql?

Page 137: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. ALTER TABLE dbo.Sessions ADD CONSTRAINTFK_Sessions_Speakers FOREIGN KEY (SessionID)REFERENCES dbo.Speakers (SpeakerID);

B. ALTER TABLE dbo.Speakers ADD CONSTRAINTFK_Speakers_Sessions FOREIGN KEY (SessionID)REFERENCES dbo.Sessions (SessionID);

C. ALTER TABLE dbo.Sessions ADD CONSTRAINTFK_Sessions_Speakers FOREIGN KEY (SpeakerID)REFERENCES dbo.Speakers (SpeakerID);

D. ALTER TABLE dbo.Speakers ADD CONSTRAINTFK_Speakers_Sessions FOREIGN KEY (SpeakerID)REFERENCES dbo.Sessions (SessionID);

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms189049.aspxhttp://msdn.microsoft.com/en-us/library/ms179610.aspxhttp://msdn.microsoft.com/en-us/library/ff878370.aspx

QUESTION 2Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 138: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 139: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 140: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 141: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to add a new column named Confirmed to the Attendees table. The solution must meet the followingrequirements:

Page 142: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Have a default value of false.Minimize the amount of disk space used.

Which code block should you use?

A. ALTER TABLE AttendeesADD Confirmed bit DEFAULT 0;

B. ALTER TABLE AttendeesADD Confirmed char(1) DEFAULT '0';

C. ALTER TABLE AttendeesADD Confirmed char(1) DEFAULT '1';

D. ALTER TABLE AttendeesADD Confirmed bit DEFAULT 1;

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Reference: http://msdn.microsoft.com/en-us/library/ms177603.aspx

QUESTION 3Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 143: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 144: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 145: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 146: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou are evaluating the table design to support a rewrite of usp_AttendeesReport. You need to recommend achange to Tables.sql that will help reduce the amount of time it takes for usp_AttendeesReport to execute.

Page 147: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

A. FullName AS (FirstName + ' ' + LastName),

B. FullName nvarchar(100) NOT NULL DEFAULT (dbo.Create FullName(FirstName,LastName)),

C. FullName AS (FirstName + ' ' + LastName) PERSISTED,

D. FullName nvarchar(100) NOT NULL CONSTRAINT DF_FullN ame DEFAULT(dbo.CreateFullName (FirstName, LastName)),

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188300.aspxhttp://msdn.microsoft.com/en-us/library/ms191250.aspx

QUESTION 4Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 148: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 149: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 150: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 151: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify usp_SelectSpeakersByName to support server-side paging. The solution must minimizethe amount of development effort required. What should you add to usp_SelectSpeakersByName?

Page 152: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. a table variableB. an OFFSET-FETCH clauseC. the ROWNUMBER keywordD. a recursive common table expression

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://www.mssqltips.com/sqlservertip/2696/comparing-performance-for-different-sql-server-paging-methods/http://msdn.microsoft.com/en-us/library/ms188385.aspxhttp://msdn.microsoft.com/en-us/library/ms180152.aspxhttp://msdn.microsoft.com/en-us/library/ms186243.aspxhttp://msdn.microsoft.com/en-us/library/ms186734.aspxhttp://www.sqlserver-training.com/how-to-use-offset-fetch-option-in-sql-server-order-by-clause/-http://www.sqlservercentral.com/blogs/juggling_with_sql/2011/11/30/using-offset-and-fetch/

QUESTION 5Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 153: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 154: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 155: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 156: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou execute usp_TestSpeakers. You discover that usp_SelectSpeakersByName uses inefficient executionplans. You need to update usp_SelectSpeakersByName to ensure that the most efficient execution plan is

Page 157: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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)

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms181714.aspx

Page 158: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

EXAM ALL

QUESTION 1You have an application that uses a view to access data from multiple tables. You need to ensure that you caninsert 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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:References:http://msdn.microsoft.com/en-us/library/ms180800.aspxhttp://msdn.microsoft.com/en-us/library/ms187956.aspx

You can modify the data of an underlying base table through a view, as long as the following conditions aretrue:

Any modifications, including UPDATE, INSERT, and DELETE statements, must reference columns fromonly one base table.The columns being modified in the view must directly reference the underlying data in the table columns.The columns cannot be derived in any other way, such as through the following:

1. An aggregate function: AVG, COUNT, SUM, MIN, MAX, GROUPING, STDEV, STDEVP, VAR, and VARP.2. A computation. The column cannot be computed from an expression that uses other columns. Columns that

are formed by using the set operators UNION, UNION ALL, CROSSJOIN, EXCEPT, and INTERSECTamount to a computation and are also not updatable.The columns being modified are not affected by GROUP BY, HAVING, or DISTINCT clauses.TOP is not used anywhere in the select_statement of the view together with the WITH CHECK OPTIONclause.

Materialize the view.In SQL this is an indexed view

CHECK OPTIONForces all data modification statements executed against the view to follow the criteria set withinselect_statement. When a row is modified through a view, the WITH CHECK OPTION makes sure the dataremains visible through the view after the modification is committed. Any updates performed directly to a view'sunderlying tables are not verified against the view, even if CHECK OPTION is specified.

SCHEMABINDINGBinds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the basetable or tables cannot be modified in a way that would affect the view definition. The view definition itself mustfirst be modified or dropped to remove dependencies on the table that is to be modified. When you useSCHEMABINDING, the select_statement must include the two-part names (schema.object) of tables, views, oruser-defined functions that are referenced. All referenced objects must be in the same database.Views or tables that participate in a view created with the SCHEMABINDING clause cannot be dropped unlessthat view is dropped or changed so that it no longer has schema binding. Otherwise, the Database Engineraises an error. Also, executing ALTER TABLE statements on tables that participate in views that have schemabinding fail when these statements affect the view definition.

If the previous restrictions prevent you from modifying data directly through a view, consider the followingoptions:INSTEAD OF Triggers

Page 159: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

INSTEAD OF triggers can be created on a view to make a view updatable. The INSTEAD OF trigger isexecuted instead of the data modification statement on which the trigger is defined. This trigger lets the userspecify the set of actions that must happen to process the data modification statement. Therefore, if anINSTEAD OF trigger exists for a view on a specific data modification statement (INSERT, UPDATE, orDELETE), the corresponding view is updatable through that statement. For more information about INSTEADOF triggers, see DML Triggers.Partitioned ViewsIf the view is a partitioned view, the view is updatable, subject to certain restrictions. When it is needed, theDatabase Engine distinguishes local partitioned views as the views in which all participating tables and the vieware on the same instance of SQL Server, and distributed partitioned views as the views in which at least one ofthe tables in the view resides on a different or remote server.

Conditions for Modifying Data in Partitioned ViewsThe following restrictions apply to statements that modify data in partitioned views:The INSERT statement must supply values for all the columns in the view, even if the underlying membertables have a DEFAULT constraint for those columns or if they allow for null values. For those member tablecolumns that have DEFAULT definitions, the statements cannot explicitly use the keyword DEFAULT.The value being inserted into the partitioning column should satisfy at least one of the underlying constraints;otherwise, the insert action will fail with a constraint violation.UPDATE statements cannot specify the DEFAULT keyword as a value in the SET clause, even if the columnhas a DEFAULT value defined in the corresponding member table.Columns in the view that are an identity column in one or more of the member tables cannot be modified byusing an INSERT or UPDATE statement.If one of the member tables contains a timestamp column, the data cannot be modified by using an INSERT orUPDATE statement.If one of the member tables contains a trigger or an ON UPDATE CASCADE/SET NULL/SET DEFAULT or ONDELETE CASCADE/SET NULL/SET DEFAULT constraint, the view cannot be modified.INSERT, UPDATE, and DELETE actions against a partitioned view are not allowed if there is a self-join with thesame view or with any of the member tables in the statement.Bulk importing data into a partitioned view is unsupported by bcp or the BULK INSERT and INSERT ... SELECT* FROM OPENROWSET(BULK...) statements. However, you can insert multiple rows into a partitioned view byusing the INSERT statement.NoteTo update a partitioned view, the user must have INSERT, UPDATE, and DELETE permissions on the membertables.

QUESTION 2You 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 theview returns the correct results. Which code segment should you run?

A. EXEC sp_refreshview @viewname = 'dbo.View1';

B. ALTER dbo.View1 WITH SCHEMABINDING, VIEW_METADATAASSELECT t1.col1, t1.col2, t2.*FROM dbo.Table1 AS t1 JOIN dbo.Table2 AS t2ON t1.col1 = t2.col2;

C. DROP dbo.View1;GO

Page 160: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

CREATE dbo.View1 WITH SCHEMABINDING, VIEW_METADATAAS SELECT t1.col1, t1.col2, t2.*FROM dbo.Table1 AS t1 JOIN dbo.Table2 AS t2ON t1.col1 = t2.col2;

D. EXEC sp_refreshsqlmodule @name = 'dbo.Table2';

Correct Answer: ASection: (none)Explanation

Explanation/Reference:References:http://msdn.microsoft.com/en-us/library/ms173846.aspxhttp://msdn.microsoft.com/en-us/library/ms187956.aspxhttp://msdn.microsoft.com/en-us/library/ms187821.aspxhttp://msdn.microsoft.com/en-us/library/bb326754.aspx

sp_refreshviewIf a view is not created with schemabinding, sp_refreshview should be run when changes are made to theobjects underlying the view that affect the definition of the view. Otherwise, the view might produce unexpectedresults when it is queried.

sp_refreshsqlmoduleUpdates the metadata for the specified non-schema-bound stored procedure, user-defined function, view, DMLtrigger, database-level DDL trigger, or server-level DDL trigger in the current database. Persistent metadata forthese objects, such as data types of parameters, can become outdated because of changes to their underlyingobjects.

sp_refreshsqlmodule should be run when changes are made to the objects underlying the module that affect itsdefinition. Otherwise, the module might produce unexpected results when it is queried or invoked. To refresh aview, you can use either sp_refreshsqlmodule or sp_refreshview with the same results.

ALTER ViewModifies a previously created view. This includes an indexed view. ALTER VIEW does not affect dependentstored procedures or triggers and does not change permissions.

SCHEMABINDINGBinds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the basetables cannot be modified in a way that would affect the view definition. The view definition itself must first bemodified or dropped to remove dependencies on the table to be modified. When you use SCHEMABINDING,the select_statement must include the two-part names (schema.object) of tables, views, or user-definedfunctions that are referenced. All referenced objects must be in the same database.Views or tables that participate in a view created with the SCHEMABINDING clause cannot be dropped, unlessthat view is dropped or changed so that it no longer has schema binding. Otherwise, the Database Engineraises an error. Also, executing ALTER TABLE statements on tables that participate in views that have schemabinding fail if these statements affect the view definition.VIEW_METADATASpecifies that the instance of SQL Server will return to the DB-Library, ODBC, and OLE DB APIs the metadatainformation about the view, instead of the base table or tables, when browse-mode metadata is beingrequested for a query that references the view. Browse-mode metadata is additional metadata that the instanceof Database Engine returns to the client-side DB-Library, ODBC, and OLE DB APIs. This metadata enables theclient-side APIs to implement updatable client-side cursors. Browse-mode metadata includes information aboutthe base table that the columns in the result set belong to.For views created with VIEW_METADATA, the browse-mode metadata returns the view name and not thebase table names when it describes columns from the view in the result set.When a view is created by using WITH VIEW_METADATA, all its columns, except a timestamp column, areupdatable if the view has INSERT or UPDATE INSTEAD OF triggers. For more information, see the Remarkssection in CREATE VIEW (Transact-SQL).

Page 161: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

QUESTION 3You are creating a table named Orders. You need to ensure that every time a new row is added to the Orderstable, a user-defined function is called to validate the row before the row is added to the table. What should youuse? More than one answer choice may achieve the goal. Select the BEST answer.

A. a Data Definition Language (DDL) triggerB. a data manipulation language (DML) triggerC. a DEFAULT constraintD. a FOREIGN KEY constraintE. a CHECK constraint

Correct Answer: ESection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

may want to be changed to dml trigger (B)

Reference:http://www.techrepublic.com/blog/programming-and-development/comparing-sql-server-constraints-and-dml-triggers/402http://msdn.microsoft.com/en-us/library/ms178110.aspx

QUESTION 4You have an index for a table in a SQL Azure database. The database is used for Online TransactionProcessing (OLTP). You discover that the index consumes more physical disk space than necessary. You needto minimize the amount of disk space that the index consumes. What should you set from the index options?

A. STATISTICS_NORECOMPUTE = OFFB. STATISTICS_NORECOMPUTE = ONC. FILLFACTOR = 0

http://www.gratisexam.com/

D. FILLFACTOR = 80

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Reference: http://msdn.microsoft.com/en-us/library/ms177459.aspxhttp://msdn.microsoft.com/en-us/library/ms188783.aspx

FILLFACTOR

Page 162: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

This topic describes what fill factor is and how to specify a fill factor value on an index in SQL Server 2012 byusing SQL Server Management Studio or Transact-SQL.The fill-factor option is provided for fine-tuning index data storage and performance. When an index is createdor rebuilt, the fill-factor value determines the percentage of space on each leaf-level page to be filled with data,reserving the remainder on each page as free space for future growth. For example, specifying a fill-factorvalue of 80 means that 20 percent of each leaf-level page will be left empty, providing space for indexexpansion as data is added to the underlying table. The empty space is reserved between the index rows ratherthan at the end of the index.The fill-factor value is a percentage from 1 to 100, and the server-wide default is 0 which means that theleaf-level pages are filled to capacity.Performance ConsiderationsPage SplitsA correctly chosen fill-factor value can reduce potential page splits by providing enough space for indexexpansion as data is added to the underlying table.When a new row is added to a full index page, the DatabaseEngine moves approximately half the rows to a new page to make room for the new row. This reorganization isknown as a page split. A page split makes room for new records, but can take time to perform and is aresource intensive operation. Also, it can cause fragmentation that causes increased I/O operations. Whenfrequent page splits occur, the index can be rebuilt by using a new or existing fill-factor value to redistribute thedata. For more information, see Reorganize and Rebuild Indexes.Although a low, nonzero fill-factor value may reduce the requirement to split pages as the index grows, theindex will require more storage space and can decrease read performance. Even for an application oriented formany insert and update operations, the number of database reads typically outnumber database writes by afactor of 5 to 10. Therefore, specifying a fill factor other than the default can decrease database readperformance by an amount inversely proportional to the fill-factor setting. For example, a fill-factor value of 50can cause database read performance to decrease by two times. Read performance is decreased because theindex contains more pages, therefore increasing the disk IO operations required to retrieve the data.Adding Data to the End of the TableA nonzero fill factor other than 0 or 100 can be good for performance if the new data is evenly distributedthroughout the table. However, if all the data is added to the end of the table, the empty space in the indexpages will not be filled. For example, if the index key column is an IDENTITY column, the key for new rows isalways increasing and the index rows are logically added to the end of the index. If existing rows will be updatedwith data that lengthens the size of the rows, use a fill factor of less than 100. The extra bytes on each page willhelp to minimize page splits caused by extra length in the rows.

STATISTICS_NORECOMPUTEQuestion: Recently I noticed an option with CREATE/ALTER INDEX called STATISTICS_NORECOMPUTE?I'm not sure I understand this option or why you'd ever want to use it? Can you explain?

Answer: In general, I don't recommend this option. But, before I get to why - let me clarify what the option does.I've heard a few folks say that it stops SQL Server from updating the statistics at the time of a rebuild; that isNOT what it does. Statistics are ALWAYS updated at the time of a REBUILD; this cannot be turned off (norwould you want to).

Instead, STATISTICS_NORECOMPUTE stops the database-wide auto-updating (auto update statistics) fromupdating the specific statistics for an index (or column-level statistic) that was created (or rebuilt) with thisoption turned on. NOTE: STATISTICS_RECOMPUTE only works when creating or rebuilding an index. If youwant to stop the auto-updating of a column-level statistic you use NORECOMPUTE when creating thatparticular statistic.

The more difficult question is if/when this would make sense to turn off – for either an index or a column-levelstatistic. And, yes, there are some cases where this can be appropriate.

The case where it makes sense to be turned off is for tables that are large in size and have very skewed datadistribution. For example, the ratio of line items per sale might be very evenly distributed between 1 and 3 itemswith an average of 2.1. Evenly distributed data tends to be easier to represent in a histogram (one of the piecesof information maintained in a statistic in SQL Server). However, sales per customer or sales per product mightbe much more uneven (and therefore skewed). And, when data distribution is skewed then then statistics arepotentially less accurate in a histogram. This is further exacerbated by the process that SQL Server maychoose of sampling your data. SQL Server will choose to sample your data (rather than reading every row)when the data they have to scan (ideally, an index but sometimes the table itself) is over 2,000 pages in size.

Page 163: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

When would you know it’s a problem? If you run a query and you evaluate the estimated rows vs. the actual rows and the estimate seems significantlydifferent from the actual, then you might have a statistics problem. If you update statistics with the followingcode:

UPDATE STATISTICS tablename indexname (or statisticsname)

Then, try the query again. If this solved the problem, then you know that you’re not updating statistics enough. Ifit does not solve the problem then try updating the statistics will a fullscan:

UPDATE STATISTICS tablename indexname WITH FULLSCAN

If the estimate and actuals are more accurate (and typically result in better plans) then you might want to turnoff the auto-updating of the statistic and solely control this particular statistics update with a job that updates thestatistic with a full scan. The positive is that your statistics are likely to be more accurate and then your planswill be as well. The negative is that updating a statistic with a full scan can be a more costly maintenanceoperation. And, you have to be especially careful that your automated process doesn’t get removed or deletedleaving this statistic to never get auto-updated again.

In summary, I don’t often recommend STATISTICS_NORECOMPUTE on indexes (or NORECOMPUTE onstatistics) but there are cases when you might be able to better control the updating of statistics as well as allowfor a FULLSCAN. In these cases (and when you’re certain that your automated routines will not be interrupted/deleted/modified), then using this option can be beneficial!

QUESTION 5You run the following code:

You need to ensure that the root node of the XML data stored in the Details column is <Order_Details>. Whatshould you implement? More than one answer choice may achieve the goal. Select the BEST answer.

A. A user-defined data typeB. A Data Definition Language (DDL) triggerC. A data manipulation language (DML) triggerD. An XML schema collectionE. An XML index

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/ms187856.aspx

QUESTION 6Your company has a SQL Azure subscription.

Page 164: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 SELECTpermission on Table1 and Table2. You need to ensure that User1 can run sp1. The solution must minimize thenumber 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.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to this reference, the answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/ms191291.aspx

whilst the owner of the stored proc and the table are the same, then it would be sufficient to grant execute onthe stored procedure to do the insert unless the stored proc contains dynamic sql

See Ownership Chains

When multiple database objects access each other sequentially, the sequence is known as a chain. Althoughsuch chains do not independently exist, when SQL Server traverses the links in a chain, SQL Server evaluatespermissions on the constituent objects differently than it would if it were accessing the objects separately.These differences have important implications for managing security.Ownership chaining enables managing access to multiple objects, such as multiple tables, by settingpermissions on one object, such as a view. Ownership chaining also offers a slight performance advantage inscenarios that allow for skipping permission checks.How Permissions Are Checked in a ChainWhen an object is accessed through a chain, SQL Server first compares the owner of the object to the owner ofthe calling object. This is the previous link in the chain. If both objects have the same owner, permissions onthe referenced object are not evaluated.Example of Ownership ChainingIn the following illustration, the July2003 view is owned by Mary. She has granted to Alex permissions on theview. He has no other permissions on database objects in this instance. What occurs when Alex selects theview?

Page 165: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

1. Alex executes SELECT * on the July2003 view. SQL Server checks permissions on the view and confirmsthat Alex has permission to select on it.

2. The July2003 view requires information from the SalesXZ view. SQL Server checks the ownership of theSalesXZ view. Because this view has the same owner (Mary) as the view that calls it, permissions onSalesXZ are not checked. The required information is returned.

3. The SalesXZ view requires information from the InvoicesXZ view. SQL Server checks the ownership of theInvoicesXZ view. Because this view has the same owner as the previous object, permissions on InvoicesXZare not checked. The required information is returned. To this point, all items in the sequence have had oneowner (Mary). This is known as an unbroken ownership chain.

4. The InvoicesXZ view requires information from the AcctAgeXZ view. SQL Server checks the ownership ofthe AcctAgeXZ view. Because the owner of this view differs from the owner of the previous object (Sam, notMary), full information about permissions on this view is retrieved. If the AcctAgeXZ view has permissionsthat enable access by Alex, information will be returned.

5. The AcctAgeXZ view requires information from the ExpenseXZ table. SQL Server checks the ownership ofthe ExpenseXZ table. Because the owner of this table differs from the owner of the previous object (Joe, notSam), full information about permissions on this table is retrieved. If the ExpenseXZ table has permissionsthat enable access by Alex, information is returned.

6. When the July2003 view tries to retrieve information from the ProjectionsXZ table, the server first checks tosee whether cross-database chaining is enabled between Database 1 and Database 2. If cross-databasechaining is enabled, the server will check the ownership of the ProjectionsXZ table. Because this table hasthe same owner as the calling view (Mary), permissions on this table are not checked. The requestedinformation is returned.

Cross-Database Ownership ChainingSQL Server can be configured to allow ownership chaining between specific databases or across all databasesinside a single instance of SQL Server. Cross-database ownership chaining is disabled by default, and shouldnot be enabled unless it is specifically required.Potential Threats

Page 166: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Ownership chaining is very useful in managing permissions on a database, but it does assume that objectowners anticipate the full consequences of every decision to grant permission on a securable. In the previousillustration, Mary owns most of the underlying objects of the July 2003 view. Because Mary has the right tomake objects that she owns accessible to any other user, SQL Server behaves as though whenever Marygrants access to the first view in a chain, she has made a conscious decision to share the views and table itreferences. In real life, this might not be a valid assumption. Production databases are far more complex thanthe one in the illustration, and the permissions that regulate access to them rarely map perfectly to theadministrative structures of the organizations that use them.

You should understand that members of highly privileged database roles can use cross-database ownershipchaining to access objects in databases external to their own. For example, if cross-database ownershipchaining is enabled between database A and database B, a member of the db_owner fixed database role ofeither database can spoof her way into the other database. The process is simple: Diane (a member ofdb_owner in database A) creates user Stuart in database A. Stuart already exists as a user in database B.Diane then creates an object (owned by Stuart) in database A that calls any object owned by Stuart in databaseB. Because the calling and called objects have a common owner, permissions on the object in database B willnot be checked when Diane accesses it through the object she has created.

QUESTION 7You are creating a database that will store usernames and passwords for an application. You need torecommend a solution to store the passwords in the database. What should you recommend? More than oneanswer choice may achieve the goal. Select the BEST answer.

A. Encrypting File System (EFS)B. One-way encryptionC. Reversible encryptionD. Transparent Data Encryption (TDE)

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Reference:http://stackoverflow.com/questions/2329582/what-is-currently-the-most-secure-one-way-encryption-algorithmhttp://msdn.microsoft.com/en-us/library/ms179331.aspx

The concept of One way encryption is to encrypt the content and store it inside the database.If a person logs in with their authentication details the password would be encrypted and would be checkedagainst the encrypted value stored in the table. The hitch is if the user forgets their password it can't beretreived back. The only way out is the password needs to be reset.

Passwords should be hashed rather than encrypted as you simply need to check the hashes of a passwordrather than see what the password is.

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

Page 167: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Each order is tracked by using one of the following statuses:FulfilledShippedOrderedReceived

You need to design the database to ensure that you can retrieve the status of an order on a given date. Thesolution must ensure that new statuses can be added in the future. What should you do? More than one answerchoice 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 Statuscolumn 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.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms191178.aspxhttp://msdn.microsoft.com/en-us/library/cc645937.aspx

QUESTION 9You are troubleshooting an application that runs a query. The application frequently causes deadlocks. Youneed to identify which transaction causes the deadlock. What should you do? More than one answer choicemay 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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://www.sqlservercentral.com/blogs/james-sql-footprint/2012/08/12/monitor-deadlock-in-sql-2012/

Page 168: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://blogs.technet.com/b/mspfe/archive/2012/06/28/how_2d00_to_2d00_monitor_2d00_deadlocks_2d00_in_2d00_sql_2d00_server.aspxhttp://msdn.microsoft.com/en-us/library/ms177648.aspxhttp://msdn.microsoft.com/en-us/library/ms176013.aspxhttp://msdn.microsoft.com/en-us/library/ms188246.aspx

QUESTION 10You plan to create a database. The database will be used by a Microsoft .NET application for a special eventthat will last for two days. During the event, data must be highly available. After the event, the database will bedeleted. You need to recommend a solution to implement the database while minimizing costs. The solutionmust not affect any existing applications. What should you recommend? More than one answer choice mayachieve the goal. Select the BEST answer.

A. SQL Server 2012 EnterpriseB. SQL AzureC. SQL Server 2012 Express with Advanced ServicesD. SQL Server 2012 Standard

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:https://www.windowsazure.com/en-us/pricing/details/http://msdn.microsoft.com/en-us/library/windowsazure/ee336279.aspxhttp://msdn.microsoft.com/en-us/library/windowsazure/ee336241.aspxhttp://msdn.microsoft.com/en-us/library/windowsazure/ee336230.aspxhttp://msdn.microsoft.com/en-us/evalcenter/hh230763.aspxhttp://msdn.microsoft.com/en-us/library/hh510202.aspxhttp://msdn.microsoft.com/en-us/library/cc645993.aspx

QUESTION 11You have a server named Server1 that has 16 processors. You plan to deploy multiple instances of SQL Server2012 to Server1. You need to recommend a method to allocate processors to each instance. What should youinclude in the recommendation? More than one answer choice may achieve the goal. Select the BEST answer.

A. Max Degree of ParallelismB. Processor affinityC. Windows System Resource Manager (WSRM)D. Resource Governor

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187104.aspxhttp://msdn.microsoft.com/en-us/library/ms188611.aspxhttp://msdn.microsoft.com/en-us/library/bb933866.aspx

Windows System Resource Manager will consider only the state of that single processor when calculating the

Page 169: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

resources available

Resource Governor ConstraintsThis release of Resource Governor has the following constraints:

Resource management is limited to the SQL Server Database Engine. Resource Governor can not be usedfor Analysis Services, Integration Services, and Reporting Services.There is no workload monitoring or workload management between SQL Server instances.Limit specification applies to CPU bandwidth and memory managed by SQL Server.OLTP workloads. Resource Governor can manage OLTP workloads but these types of queries, which aretypically very short in duration, are not always on the CPU long enough to apply bandwidth controls. Thismay skew in the statistics returned for CPU usage %.

QUESTION 12You have a SQL Azure database. You need to identify which keyword must be used to create a view that will beindexed. Which keyword should you identify?

A. DISTINCT

B. DEFAULT

C. SCHEMABINDING

D. VIEW_METADATA

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187956.aspxhttp://msdn.microsoft.com/en-us/library/ms191432.aspx

If you want to add indexes to a view you must make the view schema bound by adding the WITHSCHEMABINDING clause to the CREATE VIEW statement and you must specify the schema for each table s

QUESTION 13You have a database hosted on SQL Azure. You are developing a script to create a view that will be used toupdate the data in a table. The following is the relevant portion of the script. (Line numbers are included forreference 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

Page 170: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

D. WITH SCHEMABINDING

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to this reference, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187956.aspx

QUESTION 14You 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. Youneed to store validated XML data in Schema1.Table1. The solution must ensure that only valid XML data isaccepted by Param1. What should you do? (Each correct answer presents part of the solution. Choose all thatapply.)

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.

Correct Answer: BCDSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/bb510420.aspxhttp://msdn.microsoft.com/en-us/library/ms187856.aspxhttp://msdn.microsoft.com/en-us/library/ms176009.aspxhttp://msdn.microsoft.com/en-us/library/hh403385.aspxhttp://msdn.microsoft.com/en-us/library/ms184277.aspx

QUESTION 15You have an index for a table in a SQL Azure database. The database is used for Online TransactionProcessing (OLTP). You discover that many page splits occur when records are inserted or updated in thetable. 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

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188783.aspx

Page 171: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/ms177459.aspx

QUESTION 16You 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. Youplan to deploy an application that will search Column2. You need to create an index on Table1 to support theplanned deployment. The solution must minimize the storage requirements. Which code segment should youexecute?

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

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188783.aspxhttp://msdn.microsoft.com/en-us/library/cc280372.aspx

QUESTION 17You are creating a table named Orders. You need to ensure that every time a new row is added to the Orderstable, a table that is used for auditing is updated. What should you use? More than one answer choice mayachieve the goal. Select the BEST answer.

A. a DEFAULT constraintB. a Data Definition Language (DDL) triggerC. a CHECK constraintD. a FOREIGN KEY constraintE. a data manipulation language (DML) trigger

Correct Answer: ESection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:

Page 172: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://www.techrepublic.com/blog/programming-and-development/comparing-sql-server-constraints-and-dml-triggers/402http://msdn.microsoft.com/en-us/library/ms178110.aspx

QUESTION 18You have a database named database1. Database developers report that there are many deadlocks. You needto 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 templateB. an Extended Events sessionC. log errors by using trace flag 1204D. log errors by using trace flag 1222

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://www.sqlservercentral.com/blogs/james-sql-footprint/2012/08/12/monitor-deadlock-in-sql-2012/http://blogs.technet.com/b/mspfe/archive/2012/06/28/how_2d00_to_2d00_monitor_2d00_deadlocks_2d00_in_2d00_sql_2d00_server.aspx

QUESTION 19You execute the following code.

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

Page 173: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms179859.aspxhttp://msdn.microsoft.com/en-us/library/ms187748.aspx

QUESTION 20You have a SQL Server 2012 database named DB1. You have a backup device named Device1. You discoverthat the log file for the database is full. You need to ensure that DB1 can complete transactions. The solutionmust 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

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms186865.aspxhttp://msdn.microsoft.com/en-us/library/ms179478.aspxhttp://msdn.microsoft.com/en-us/library/ms190925.aspx

BACKUP LOG DB1 TO Device1One of the simplest ways to truncate the log is to perform a normal log backup:BACKUP LOG AdventureWorks TO DISK = 'c:\backups\advw20120317.trn'This will not break the LSN chain, and will effectively truncate the inactive portion of the log, IF a checkpoint hasbeen performed since the last log backup.Backing up the log in order to truncate it will not reduce the size of the physical log file, it will only clear inactivetransactions, thus preventing further unnecessary growth of the log file.

BACKUP LOG DB1 TO Device1 WITH COPY_ONLYSpecifies that the backup is a copy-only backup, which does not affect the normal sequence of backups. Acopy-only backup is created independently of your regularly scheduled, conventional backups. A copy-onlybackup does not affect your overall backup and restore procedures for the database.Copy-only backups were introduced in SQL Server 2005 for use in situations in which a backup is taken for aspecial purpose, such as backing up the log before an online file restore. Typically, a copy-only log backup isused once and then deleted.When used with BACKUP DATABASE, the COPY_ONLY option creates a full backup that cannot serve as adifferential base. The differential bitmap is not updated, and differential backups behave as if the copy-onlybackup does not exist. Subsequent differential backups use the most recent conventional full backup as their

Page 174: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

base.ImportantIf DIFFERENTIAL and COPY_ONLY are used together, COPY_ONLY is ignored, and a differential backup iscreated.When used with BACKUP LOG, the COPY_ONLY option creates a copy-only log backup, which does nottruncate the transaction log. The copy-only log backup has no effect on the log chain, and other log backupsbehave as if the copy-only backup does not exist.

BACKUP LOG DB1 TO Device1 WITH TRUNCATE_ONLYAn older method of truncating the log was to use BACKUP LOG WITH TRUNCATE_ONLY or BACKUP LOGWITH NO_LOG. These methods have been deprecated in SQL Server 2005, and were completely removedfrom SQL Server 2008 – and for good reason.

QUESTION 21You have a server that has SQL Server 2012 installed. You need to identify which parallel execution plans arerunning in serial. Which tool should you use?

A. Performance MonitorB. Database Engine Tuning AdvisorC. Extended EventsD. Data Profile Viewer

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Verified answer as correct.

References:http://msdn.microsoft.com/en-us/library/bb677278.aspxhttp://msdn.microsoft.com/en-us/library/bb630282.aspxhttp://www.sql-server-performance.com/2006/query-execution-plan-analysis/http://www.simple-talk.com/sql/learn-sql-server/understanding-and-using-parallelism-in-sql-server/http://www.sqlservercentral.com/articles/SQL+Server+2012/At+last%2c+execution+plans+show+true+thread+reservations./92458/http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-parallel-query-execution-plan.aspxhttp://sqlblog.com/blogs/paul_white/archive/2012/05/02/parallel-row-goals-gone-rogue.aspxhttp://msdn.microsoft.com/en-us/library/bb895310.aspxhttp://msdn.microsoft.com/en-us/library/bb895313.aspxhttp://msdn.microsoft.com/en-us/library/hh231122.aspx

QUESTION 22You are creating a table to support an application that will cache data outside of SQL Server. The applicationwill detect whether cached values were changed before it updates the values. You need to create the table, andthen 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())

Page 175: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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')

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms182776.aspxhttp://msdn.microsoft.com/en-us/library/ms187942.aspxhttp://msdn.microsoft.com/en-us/library/ms190348.aspx

QUESTION 23You use SQL Server 2012 to maintain the data used by the applications at your company. You plan to create atable 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,

Correct Answer: C

Page 176: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms184391.aspxhttp://msdn.microsoft.com/en-us/library/ms143726.aspxhttp://msdn.microsoft.com/en-us/library/ff848763.aspx

QUESTION 24You are creating a database that will store usernames and credit card numbers for an application. You need torecommend a solution to store the credit card numbers in the database. What should you recommend? Morethan one answer choice may achieve the goal. Select the BEST answer.

A. One-way encryptionB. Reversible encryptionC. Encrypting File System (EFS)D. Transparent Data Encryption (TDE)

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://technet.microsoft.com/en-us/library/hh994559(v=ws.10).aspxhttp://msdn.microsoft.com/en-us/library/bb964742.aspxhttp://msdn.microsoft.com/en-us/library/bb510663.aspx

QUESTION 25You 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 followingrequirements:

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 snapshotB. change data captureC. a data-tier applicationD. SQL Server Integration Services (SSIS)E. SQL Data Sync

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

thinks C

Page 177: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

References:http://msdn.microsoft.com/en-us/library/windowsazure/ee336279.aspxhttp://msdn.microsoft.com/en-us/library/windowsazure/hh694043.aspxhttp://msdn.microsoft.com/en-us/library/hh456371.aspx

QUESTION 26You have a SQL Server 2012 database named Database1. Database1 has a data file nameddatabase1_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 logbackups in the future. Which code segment should you execute? To answer, move the appropriate codesegments from the list of code segments to the answer area and arrange them in the correct order.

Build List and Reorder:

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://technet.microsoft.com/en-us/library/ms190757.aspxhttp://technet.microsoft.com/en-us/library/ms189493.aspxhttp://technet.microsoft.com/en-us/library/ms365418.aspx

Page 178: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://technet.microsoft.com/en-us/library/ms189272.aspxhttp://technet.microsoft.com/en-us/library/ms179478.aspx

QUESTION 27You have a database named DB1. You plan to create a stored procedure that will insert rows into three differenttables. Each insert must use the same identifying value for each table, but the value must increase from oneinvocation of the stored procedure to the next. Occasionally, the identifying value must be reset to its initialvalue. You need to design a mechanism to hold the identifying values for the stored procedure to use. Whatshould 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 thestored 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 thevalue 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 thestored procedure. Increment the sequence object to the next value by using an ALTER SEQUENCEstatement. 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 eachtable. Insert new rows into the tables by using the stored procedure. Use the DBCC CHECKIDENTcommand to reset the columns as needed.

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ff878091.aspxhttp://msdn.microsoft.com/en-us/library/ms176057.aspxhttp://msdn.microsoft.com/en-us/library/ff878572.aspxhttp://msdn.microsoft.com/en-us/library/ff878058.aspx

QUESTION 28DRAG DROPYou plan to install two SQL Server 2012 environments named Environment1 and Environment2. Your companyidentifies 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 eachenvironment to ensure that all data remains available if a physical server fails. How many servers should youidentify? To answer, drag the appropriate number to the correct environment in the answer area.

Select and Place:

Page 179: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

May need to be 2, 2

References:http://msdn.microsoft.com/en-us/library/ms189852.aspxhttp://msdn.microsoft.com/en-us/library/hh510230.aspx

QUESTION 29DRAG DROPYou 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 thedatabase 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 processoroverhead. Which features should you identify? To answer, drag the appropriate feature to the correctrequirement in the answer area.

Select and Place:

Page 180: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)

Page 181: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/windows/desktop/aa364223.aspxhttp://msdn.microsoft.com/en-us/library/bb510667.aspxhttp://msdn.microsoft.com/en-us/library/bb879935.aspxhttp://msdn.microsoft.com/en-us/library/bb934049.aspxhttp://msdn.microsoft.com/en-us/library/windows/hardware/gg487306.aspxhttp://msdn.microsoft.com/en-us/library/ff773063.aspx

QUESTION 30DRAG DROPYou 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? Toanswer, drag the appropriate feature to the correct monitoring requirement in the answer area.

Select and Place:

Correct Answer:

Page 182: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188754.aspxhttp://msdn.microsoft.com/en-us/library/cc879320.aspxhttp://msdn.microsoft.com/en-us/library/hh212951.aspxhttp://msdn.microsoft.com/en-us/library/bb933866.aspxhttp://msdn.microsoft.com/en-us/library/hh245121.aspx

QUESTION 31You have a table named Table1 that contains 1 million rows. Table1 contains a column named Column1 thatstores 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 codesegment should you execute before you remove Column1? To answer, move the appropriate code segmentsfrom the list of code segments to the answer area and arrange them in the correct order.

Build List and Reorder:

Page 183: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://www.databasejournal.com/features/mssql/article.php/3922881/Column-Level-Encryption-in-SQL-Server.htmhttp://msdn.microsoft.com/en-us/library/bb510663.aspxhttp://msdn.microsoft.com/en-us/library/ms179331.aspxhttp://msdn.microsoft.com/en-us/library/ms175491.aspxhttp://msdn.microsoft.com/en-us/library/ms181860.aspxhttp://msdn.microsoft.com/en-us/library/ms174361.aspxhttp://msdn.microsoft.com/en-us/library/ms190499.aspx

Page 184: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/ms177938.aspxhttp://msdn.microsoft.com/en-us/library/ms345262.aspxhttp://msdn.microsoft.com/en-us/library/ms188357.aspxhttp://msdn.microsoft.com/en-us/library/ms175491.aspx

QUESTION 32DRAG DROPYou 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 tomove the table to another schema named Schema2. What should you create? To answer, drag the appropriatecode segments to the correct location in the answer area.

Build List and Reorder:

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/ms173423.aspx

QUESTION 33DRAG DROPYou plan to deploy SQL Server 2012. Your company identifies the following monitoring requirements for thedatabase:

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.

Page 185: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

You need to identify which feature meets each monitoring requirement. Which features should you identify? Toanswer, drag the appropriate feature to the correct monitoring requirement in the answer area.

Select and Place:

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:

Page 186: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/bb510667.aspxhttp://msdn.microsoft.com/en-us/library/ms180982.aspxhttp://msdn.microsoft.com/en-us/library/ms141026.aspxhttp://msdn.microsoft.com/en-us/library/ms188396.aspx

QUESTION 34DRAG DROPYou are designing two stored procedures named Procedure1 and Procedure2. You identify the followingrequirements:

Procedure1 must take a parameter that ensures that multiple rows of data can pass into the storedprocedure.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 youidentify? 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:

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms131102.aspxhttp://msdn.microsoft.com/en-us/library/bb522446.aspxhttp://msdn.microsoft.com/en-us/library/bb510489.aspx

Page 187: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

QUESTION 35DRAG DROPYou plan to deploy SQL Server 2012. You must create two tables named Table1 and Table2 that will have thefollowing specifications:

Table1 will contain a date column named Column1 that will contain a null value approximately 80 percent ofthe 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 thestorage requirements for the tables. Which options should you recommend? To answer, drag the appropriateoptions to the correct column in the answer area.

Select and Place:

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/cc280604.aspxhttp://msdn.microsoft.com/en-us/library/ms186241.aspx

QUESTION 36

Page 188: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

DRAG DROPYou are designing a database for a university. The database will contain two tables named Classes andStudentGrades 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 technologiesshould you identify? To answer, drag the appropriate technology to the correct table in the answer area.

Select and Place:

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/gg471497.aspxhttp://msdn.microsoft.com/en-us/library/ff929144.aspxhttp://msdn.microsoft.com/en-us/library/ms189563.aspx

Page 189: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/ms190174.aspxhttp://msdn.microsoft.com/en-us/library/ms187956.aspx

QUESTION 37DRAG DROPYou 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 yourecommend for each column? To answer, drag the appropriate data type to the correct column in the answerarea.

Select and Place:

Correct Answer:

Page 190: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Section: (none)Explanation

Explanation/Reference:According to this reference, the answer looks correct.

Reference:http://msdn.microsoft.com/en-US/library/ms187752.aspx

QUESTION 38DRAG DROPYou are designing an authentication strategy for a new server that has SQL Server 2012 installed. The strategymust 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 theamount of events that are logged. Which technologies should you recommend? To answer, drag theappropriate solution to the correct business requirement in the answer area.

Select and Place:

Page 191: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms175850.aspxhttp://msdn.microsoft.com/en-us/library/bb326598.aspxhttp://msdn.microsoft.com/en-us/library/ms187634.aspx

Page 192: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/bb510667.aspx

QUESTION 39You 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. Whatshould 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;GOCREATE INDEX IX_Sales_OrderDate ON Sales(OrderDate) ;GO

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

Thinks B

Page 193: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Reference:http://www.c-sharpcorner.com/UploadFile/skumaar_mca/good-practices-to-write-the-stored-procedures-in-sql-server/

QUESTION 40You plan to design an application that temporarily stores data in a SQL Azure database. You need to identifywhich types of database objects can be used to store data for the application. The solution must ensure that theapplication can make changes to the schema of a temporary object during a session. Which type of objectsshould you identify?

A. Common table expressions (CTEs)B. Temporary tablesC. Table variablesD. Temporary stored procedures

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, the answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms175972.aspxhttp://msdn.microsoft.com/en-us/library/ms189084.aspxhttp://msdn.microsoft.com/en-us/library/ms175010.aspxhttp://msdn.microsoft.com/en-us/library/bb510489.aspxhttp://msdn.microsoft.com/en-us/library/ms187926.aspxhttp://zacksfiasco.com/post/2010/01/21/SQL-Server-Temporary-Stored-Procedures.aspx

QUESTION 41Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

Page 194: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Application RequirementsThe 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 Invoicetable.To protect against the theft of backup disks, invoice data must be protected by using the highest level ofencryption.The solution must provide a table-valued function that provides users with the ability to filter invoices bycustomer.Indexes must be optimized periodically based on their fragmentation by using the minimum amount ofadministrative effort.

Usp_InsertInvoices.sql

Page 195: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

InvoicesByCustomer.sql

Page 196: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Legacy.sql

CountryFromID.sql

IndexManagement.sql

Page 197: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify the function in CountryFromID.sql to ensure that the country name is returned instead ofthe country ID. Which line of code should you modify in CountryFromID.sql?

A. 404B. 06C. 19D. 05

Correct Answer: CSection: (none)

Page 198: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms186755.aspxhttp://msdn.microsoft.com/en-us/library/ms191320.aspx

QUESTION 42Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

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

Application RequirementsThe 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

Page 199: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Usp_InsertInvoices.sql

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

Page 200: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

InvoicesByCustomer.sql

Legacy.sql

CountryFromID.sql

Page 201: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

IndexManagement.sql

Page 202: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionWhich data type should you use for CustomerlD?

A. varchar(11)B. bigintC. nvarchar(11)D. char(11)

Correct Answer: DSection: (none)Explanation

Page 203: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Explanation/Reference:According to these references, this answer looks correct.

Thinks D

References:http://msdn.microsoft.com/en-us/library/ms176089.aspxhttp://msdn.microsoft.com/en-us/library/ms187745.aspx

QUESTION 43Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

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

Application RequirementsThe 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.

Page 204: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 Invoicetable.To protect against the theft of backup disks, invoice data must be protected by using the highest level ofencryption.The solution must provide a table-valued function that provides users with the ability to filter invoices bycustomer.Indexes must be optimized periodically based on their fragmentation by using the minimum amount ofadministrative effort.

Usp_InsertInvoices.sql

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

Page 205: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

InvoicesByCustomer.sql

Legacy.sql

CountryFromID.sql

Page 206: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

IndexManagement.sql

Page 207: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify InsertInvoice to comply with the application requirements. Which code segment should youexecute?

A. OPEN CERT1;ALTER PROCEDURE InsertInvoice WITH ENCRYPTION;CLOSE CERT1;

B. ADD SIGNATURE TO InsertInvoice BY CERTIFICATE CERT2;

Page 208: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

C. OPEN CERT2;ALTER PROCEDURE InsertInvoice WITH ENCRYPTION;CLOSE CERT2;

D. ADD SIGNATURE TO InsertInvoice BY CERTIFICATE CERT1;

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/bb669102.aspx

QUESTION 44Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

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

Application Requirements

Page 209: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 Invoicetable.To protect against the theft of backup disks, invoice data must be protected by using the highest level ofencryption.The solution must provide a table-valued function that provides users with the ability to filter invoices bycustomer.Indexes must be optimized periodically based on their fragmentation by using the minimum amount ofadministrative effort.

Usp_InsertInvoices.sql

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

Page 210: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

InvoicesByCustomer.sql

Legacy.sql

CountryFromID.sql

Page 211: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

IndexManagement.sql

Page 212: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to convert the functionality of Legacy.sql to use a stored procedure. Which code segment should thestored 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),

Page 213: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187926.aspxhttp://msdn.microsoft.com/en-us/library/ms190782.aspxhttp://msdn.microsoft.com/en-us/library/bb669091.aspxhttp://msdn.microsoft.com/en-us/library/windows/desktop/ms709342.aspxhttp://msdn.microsoft.com/en-us/library/ms188001.aspx

QUESTION 45Case Study 7: Invoice Schema ScenarioApplication InformationYour company receives invoices in XML format from customers. Currently, the invoices are stored as files andprocessed by a desktop application. The application has several performance and security issues. Theapplication is being migrated to a SQL Server-based solution. A schema named InvoiceSchema has beencreated for the invoices xml. The data in the invoices is sometimes incomplete. The incomplete data must bestored and processed as-is. Users cannot filter the data provided through views. You are designing a SQLServer 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 taxcomponent will be provided as a DLL file named Treytax.dll and a source code file named Amortize.cs. Thecomponent will expose a class named TreyResearch and a method named Amortize(). The files are located inc:\temp\.

The following graphic shows the planned tables:

Page 214: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Application RequirementsThe 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 Invoicetable.To protect against the theft of backup disks, invoice data must be protected by using the highest level ofencryption.The solution must provide a table-valued function that provides users with the ability to filter invoices bycustomer.Indexes must be optimized periodically based on their fragmentation by using the minimum amount ofadministrative effort.

Usp_InsertInvoices.sql

Page 215: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Invoices.xmlAll customer IDs are 11 digits. The first three digits of a customer ID represent the customer's country. Theremaining eight digits are the customer's account number. The following is a sample of a customer invoice inXML format:

InvoicesByCustomer.sql

Page 216: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Legacy.sql

CountryFromID.sql

IndexManagement.sql

Page 217: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to build a stored procedure that amortizes the invoice amount. Which code segment should you useto create the stored procedure? To answer, move the appropriate code segments from the list of codesegments to the answer area and arrange them in the correct order.

Build List and Reorder:

Page 218: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer:

Section: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms131089.aspxhttp://msdn.microsoft.com/en-us/library/ms131048.aspxhttp://msdn.microsoft.com/en-us/library/ms187926.aspx

QUESTION 46Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the databaseadministrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic shows

Page 219: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a solution for the planned changes to the customer classifications. What should yourecommend? (Each correct answer presents part of the solution. Choose all that apply.)

Page 220: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.

Correct Answer: ACSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/cc645937.aspx

QUESTION 47Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the databaseadministrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic showsthe 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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive different tables from the Sales and Customers databases in a table named Table1. After Table1 is created,

Page 221: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

the reporting process reads data from a table in the Products database and searches for information in Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a change to sp3 to ensure that the procedure completes only if all of the UPDATEstatements complete. Which change should you recommend?

A. Set the IMPLICIT_TRANSACTIONS option to off.B. Set the XACT_ABORT option to offC. Set the IMPLICIT_TRANSACTIONS option to on.D. Set the XACT_ABORT option to on.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188792.aspxhttp://msdn.microsoft.com/en-us/library/ms188317.aspxhttp://msdn.microsoft.com/en-us/library/ms187807.aspx

QUESTION 48Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the database

Page 222: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

administrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic showsthe 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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a solution to meet the security requirements of the junior database administrators.

Page 223: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

What should you include in the recommendation?

A. a shared loginB. a database roleC. a credentialD. a server role

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Thinks B

References:http://msdn.microsoft.com/en-us/library/ms188659.aspxhttp://msdn.microsoft.com/en-us/library/ms189121.aspxhttp://msdn.microsoft.com/en-us/library/ms161950.aspxhttp://msdn.microsoft.com/en-us/library/ms188642.aspxhttp://msdn.microsoft.com/en-us/library/aa337562.aspx

QUESTION 49Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

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

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

Page 224: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

The Inventory database is used mainly for reports. The database is recreated every day. A full backup of thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a solution to minimize the amount of time it takes to execute sp1. With what shouldyou recommend replacing Table1?

A. a temporary tableB. a functionC. a viewD. a table variable

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:

Page 225: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/ms175503.aspxhttp://msdn.microsoft.com/en-us/library/ms190174.aspx

QUESTION 50Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the databaseadministrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic showsthe 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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a Recovery

Page 226: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Point Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a disaster recovery strategy for the Inventory database. What should you include inthe recommendation?

A. Log shippingB. AlwaysOn Availability GroupsC. SQL Server Failover ClusteringD. Peer-to-peer replication

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/cc645993.aspxhttp://msdn.microsoft.com/en-us/library/ms187103.aspxhttp://msdn.microsoft.com/en-us/library/ms190640.aspx

QUESTION 51Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

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

Page 227: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a solution to ensure that sp4 adheres to the security requirements. What should youinclude in the recommendation?

A. Configure data manipulation language (DML) triggers.B. Enable SQL Server Audit.C. Enable trace flags.D. Enable C2 audit tracing.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Page 228: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

References:http://msdn.microsoft.com/en-us/library/ms178110.aspxhttp://msdn.microsoft.com/en-us/library/cc280386.aspxhttp://msdn.microsoft.com/en-us/library/ms188396.aspxhttp://msdn.microsoft.com/en-us/library/ms187634.aspx

QUESTION 52Case Study 1: A DatumOverviewGeneral OverviewA. Datum Corporation has offices in Miami and Montreal. The network contains a single Active Directory forestnamed adatum.com. The offices connect to each other by using a WAN link that has a 5-ms latency. A. Datumstandardizes its database platform by using SQL Server 2012 Standard edition.

DatabasesEach office contains databases named Sales, Inventory, Customers, Products, Personnel, and Dev. Serversand databases are managed by a team of database administrators. Currently, all of the databaseadministrators have the same level of permissions on all of the servers and all of the databases. TheCustomers database contains two tables named Customers and Classifications. The following graphic showsthe 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 thedatabase currently takes three hours to complete.

Stored ProceduresA stored procedure named sp1 generates millions of rows of data for multiple reports. Sp1 combines data fromfive 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 Table1based on input from the Products table. After the process is complete, Table1 is deleted. A stored procedurenamed sp2 is used to generate a product list. Sp2 takes several minutes to run due to locks on the tables theprocedure accesses. A stored procedure named sp3 is used to update prices. Sp3 is composed of severalUPDATE statements called in sequence from within a transaction. Currently, if one of the UPDATE statementsfails, the stored procedure continues to execute. A stored procedure named sp4 calls stored procedures in theSales, 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 sp5changes data in multiple databases. Security checks are performed each time sp5 accesses a database. Yoususpect that the security checks are slowing down the performance of sp5. All stored procedures accessed byuser applications call nested stored procedures. The nested stored procedures are never called directly.

Page 229: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Design RequirementsData RecoveryYou must be able to recover data from the Inventory database if a storage failure occurs. You have a RecoveryPoint Objective (RPO) of one hour. You must be able to recover data from the Dev database if data is lostaccidentally. You have a Recovery Point Objective (RPO) of one day.

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

SecurityA group of junior database administrators must be able to view the server state of the SQL Server instance thathosts the Sales database. The junior database administrators will not have any other administrative rights.------------QuestionYou need to recommend a change to sp3 to ensure that the procedure continues to execute even if one of theUPDATE 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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188792.aspxhttp://msdn.microsoft.com/en-us/library/ms188317.aspxhttp://msdn.microsoft.com/en-us/library/ms187807.aspx

QUESTION 53Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERPapplication. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts 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 namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

Page 230: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

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

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

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

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Page 231: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend a solution that addresses the concurrency requirement. What should yourecommend?

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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms191242%28v=SQL.105%29.aspxhttp://msdn.microsoft.com/en-us/library/bb677357.aspxhttp://msdn.microsoft.com/en-us/library/ms378149.aspx

QUESTION 54Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERPapplication. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts applied to each product in a purchase order. The product price is stored in a table named Products.

Page 232: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

The Products table was defined by using the SQL_Latin1_General_CP1_CI_AS collation. A column namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

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

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

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

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

Missing Data IssuesCustomers report that when they make a price change in the Products table, they cannot retrieve the price that

Page 233: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

the item was sold for in previous orders.

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend a solution that addresses the backup issue. The solution must minimize the amount ofdevelopment effort. What should you include in the recommendation?

A. filegroupsB. indexed viewsC. table partitioningD. indexes

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms187048.aspxhttp://msdn.microsoft.com/en-us/library/ms189563.aspxhttp://msdn.microsoft.com/en-us/library/ms190174.aspxhttp://msdn.microsoft.com/en-us/library/ms190787.aspxhttp://msdn.microsoft.com/en-us/library/ms175049.aspx

QUESTION 55Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERP

Page 234: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

application. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts 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 namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

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

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

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

Page 235: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

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

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend a solution that addresses the index fragmentation and index width issue. What shouldyou 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.

Correct Answer: BCDSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://technet.microsoft.com/en-us/library/ms190639.aspxhttp://msdn.microsoft.com/en-us/library/ms190457.aspxhttp://msdn.microsoft.com/en-us/library/ms186342.aspxhttp://msdn.microsoft.com/en-us/library/ms189280.aspxhttp://stackoverflow.com/questions/255569/sql-data-type-for-primary-key-sql-serverhttp://sqlservernet.blogspot.com/2012/01/which-data-type-is-good-for-primary-key.html

Page 236: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://msdn.microsoft.com/en-us/library/jj591574.aspxhttp://www.informit.com/articles/article.aspx?p=25862&seqNum=5

QUESTION 56Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERPapplication. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts 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 namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

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

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

Page 237: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

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

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend a solution that meets the data recovery requirement. What should you include in therecommendation?

A. a differential backupB. snapshot isolationC. a transaction log backupD. a database snapshot

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

Page 238: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms175158.aspxhttp://msdn.microsoft.com/en-us/library/ms378149.aspxhttp://msdn.microsoft.com/en-us/library/ms187048.aspx

QUESTION 57Case Study 2: Contoso LtdOverviewApplication OverviewContoso, Ltd., is the developer of an enterprise resource planning (ERP) application. Contoso is designing anew 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 supplierdata. The import process updates thousands of rows simultaneously, requires exclusive access to thedatabase, and runs daily. You receive several support calls reporting unexpected behavior in the ERPapplication. After analyzing the calls, you conclude that users made changes directly to the tables in thedatabase.

TablesThe current database schema contains a table named OrderDetails. The OrderDetails table containsinformation about the items sold for each purchase order. OrderDetails stores the product ID, quantities, anddiscounts 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 namedProductName 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 12months are stored in a table named OrdersOld. The previous version of the ERP application relied on table-level security.

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

Customer ProblemsInstallation IssuesThe current version of the ERP application requires that several SQL Server logins be set up to functioncorrectly. Most customers set up the ERP application in multiple locations and must create logins multipletimes.

Page 239: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Index Fragmentation IssuesCustomers discover that clustered indexes often are fragmented. To resolve this issue, the customersdefragment the indexes more frequently. All of the tables affected by fragmentation have the following columnsthat are used as the clustered index key:

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

Search IssuesUsers report that when they search product names, the search results exclude product names that containaccents, unless the search string includes the accent.

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

Query Performance IssuesCustomers report that query performance degrades very quickly. Additionally, the customers report that userscannot run queries when SQL Server runs maintenance tasks.

Import IssuesDuring the monthly import process, database administrators receive many supports call from users who reportthat they cannot access the supplier data. The database administrators want to reduce the amount of timerequired to import the data.

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

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

Security RequirementsYou must provide users with the ability to execute functions within the ERP application, without having directaccess to the underlying tables.

Concurrency RequirementsYou must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.------------QuestionYou need to recommend changes to the ERP application to resolve the search issue. The solution mustminimize the impact on other queries generated from the ERP application. What should you recommendchanging?

A. the data type of the ProductName columnB. the collation of the Products tableC. the collation of the ProductName columnD. the index on the ProductName column

Page 240: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ff848763.aspxhttp://msdn.microsoft.com/en-us/library/ms143726.aspxhttp://msdn.microsoft.com/en-us/library/ms190920.aspx

QUESTION 58Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend an isolation level for usp_UpdateOrderDetails. Which isolation level shouldrecommend?

A. repeatable readB. serializable

Page 241: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

C. read uncommittedD. read committed

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms378149.aspxhttp://msdn.microsoft.com/en-us/library/ms173763.aspx

QUESTION 59Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a solution for Application1 that meets the security requirements. What should youinclude in the recommendation?

Page 242: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. Encrypted columnsB. Certificate AuthenticationC. Signed stored proceduresD. Secure Socket Layer (SSL)

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms179331.aspx

QUESTION 60Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a solution to improve the performance of usp_UpdateInventory. The solution mustminimize the amount of development effort. What should you include in the recommendation?

Page 243: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. a table variableB. a subqueryC. a common table expressionD. a cursor

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

QUESTION 61Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a disk monitoring solution that meets the business requirements. What should youinclude in the recommendation?

Page 244: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. a maintenance planB. a SQL Server Agent alertC. an auditD. a dynamic management view

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188754.aspxhttp://msdn.microsoft.com/en-us/library/cc280386.aspxhttp://msdn.microsoft.com/en-us/library/ms180982.aspxhttp://msdn.microsoft.com/en-us/library/ms187658.aspx

QUESTION 62Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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 strategymust minimize changes to the databases and to the applications.

------------

Page 245: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

QuestionYou need to recommend a solution to allow application users to perform UPDATE operations on the databasetables. 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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188354.aspxhttp://msdn.microsoft.com/en-us/library/ms189121.aspxhttp://msdn.microsoft.com/en-us/library/ms131287.aspxhttp://msdn.microsoft.com/en-us/library/ms186755.aspxhttp://msdn.microsoft.com/en-us/library/ms191320.aspxhttp://msdn.microsoft.com/en-us/library/bb510667.aspx

QUESTION 63Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou 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.

Page 246: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a solution for the deployment of SQL Server 2012. The solution must meet thebusiness requirements. What should you include in the recommendation?

A. Deploy two servers that have SQL Server 2012 installed. Implement AlwaysOn Availability Groups on bothservers.

B. Upgrade the existing SQL Server 2005 instance to SQL Server 2012. Deploy a new server that has SQLServer 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.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/bb677622.aspxhttp://msdn.microsoft.com/en-us/library/ff877884.aspx

QUESTION 64Case Study 3: Litware, IncOverviewYou 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 newweb-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 applicationthat uses a SQL Server 2005 database named App1_DB. App1_DB will remain in production.

RequirementsPlanned ChangesYou plan to deploy a SQL Server 2012 instance that will contain two databases named Database1 andDatabase2. All database files will be stored in a highly available SAN. Database1 will contain two tables namedOrders and OrderDetails. Database1 will also contain a stored procedure named usp_UpdateOrderDetails. Thestored procedure is used to update order information. The stored procedure queries the Orders table twiceeach time the procedure executes. The rows returned from the first query must be returned on the secondquery unchanged along with any rows added to the table between the two read operations. Database1 willcontain several queries that access data in the Database2 tables. Database2 will contain a table namedInventory. Inventory will contain over 100 GB of data. The Inventory table will have two indexes: a clusteredindex on the primary key and a nonclustered index. The column that is used as the primary key will use theidentity property. Database2 will contain a stored procedure named usp_UpdateInventory. usp_UpdateInventorywill manipulate a table that contains a self-join that has an unlimited number of hierarchies. All data inDatabase2 is recreated each day and does not change until the next data creation process. Data fromDatabase2 will be accessed periodically by an external application named Application1. The data fromDatabase2 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 RequirementsYou have the following requirements:

Costs for new licenses must be minimized.

Page 247: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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 strategymust minimize changes to the databases and to the applications.

------------QuestionYou need to recommend a solution to synchronize Database2 to App1_Db1. What should you recommend?

A. Change data captureB. Snapshot replicationC. Transactional replicationD. Master Data Services

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ee633752.aspxhttp://msdn.microsoft.com/en-us/library/ms151198.aspxhttp://msdn.microsoft.com/en-us/library/cc645937.aspx

QUESTION 65Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 248: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 249: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 250: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to provide referential integrity between the Offices table and Employees table. Which code segmentor 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 CONSTRAINTFK_Offices_Employees FOREIGN KEY (EmployeeID)REFERENCES dbo.Employees (EmployeeID);

B. ALTER TABLE dbo.Offices ADD CONSTRAINTPK_Offices_EmployeeID PRIMARY KEY (EmployeeID);

C. ALTER TABLE dbo.Employees ADD CONSTRAINTPK_Employees_EmployeeID PRIMARY KEY (EmployeeID);

D. ALTER TABLE dbo.Employees ADD CONSTRAINTFK_Employees_Offices FOREIGN KEY (OfficeID)REFERENCES dbo.Offices (OfficeID);

Correct Answer: ACSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Page 251: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

References:http://msdn.microsoft.com/en-us/library/ms189049.aspx

QUESTION 66Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 252: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 253: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou execute usp_SelectEmployeesByName multiple times, passing strings of varying lengths to @LastName.You discover that usp_SelectEmployeesByName uses inefficient execution plans. You need to updateusp_SelectEmployeesByName to ensure that the most efficient execution plan is used. What should you add atline 31 of StoredProcedures.sql?

A. OPTION (ROBUST PLAN)

B. OPTION (OPTIMIZE FOR UNKNOWN)

C. OPTION (KEEP PLAN)

D. OPTION (KEEPFIXED PLAN)

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms181714.aspx

QUESTION 67

Page 254: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 255: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 256: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to create the object used by the parameter of usp_UpdateEmployeeName. Which code segmentshould you use?

A. CREATE XML SCHEMA COLLECTION EmployeesInfo

B. CREATE TYPE EmployeesInfo AS Table

C. CREATE TABLE EmployeesInfo

D. CREATE SCHEMA EmployeesInfo

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms175010.aspxhttp://msdn.microsoft.com/en-us/library/ms174979.aspxhttp://msdn.microsoft.com/en-us/library/ms189462.aspxhttp://msdn.microsoft.com/en-us/library/ms176009.aspx

Page 257: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

QUESTION 68Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 258: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 259: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to add a new column named Confirmed to the Employees table. The solution must meet the followingrequirements:

Have a default value of TRUE.Minimize the amount of disk space used.

Which code segment should you use?

A. ALTER TABLE EmployeesADD Confirmed bit DEFAULT 0;

B. ALTER TABLE EmployeesADD Confirmed char(1) DEFAULT "1";

C. ALTER TABLE EmployeesADD Confirmed char(1) DEFAULT '0';

D. ALTER TABLE EmployeesADD Confirmed bit DEFAULT 1;

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

Page 260: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

References:http://msdn.microsoft.com/en-us/library/ms177603.aspxhttp://msdn.microsoft.com/en-us/library/ms176089.aspx

QUESTION 69Case Study 4: Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 hasSQL Server 2008 Standard installed. You have an application that is used to manage employees and officespace. Users report that the application has many errors and is very slow. You are updating the application toresolve the issues. You plan to create a new database on SQL1 to support the application. The script that youplan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use tocreate the stored procedures for the new database is shown in StoredProcedures.sql. The script that you planto use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides onSQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. A storedprocedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The storedprocedures executing usp_UpdateEmployeeName will always handle transactions. A stored procedure namedusp_SelectEmployeesByName will be used to retrieve the names of employees.Usp_SelectEmployeesByName can read uncommitted data. A stored procedure namedusp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future.

StoredProcedures.sql

Page 261: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 262: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Tables.sql

Page 263: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify usp_SelectEmployeesByName to support server-side paging. The solution must minimizethe amount of development effort required. What should you add to usp_SelectEmployeesByName?

A. an OFFSET-FETCH clauseB. a recursive common table expressionC. a table variableD. the ROWNUMBER keyword

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://www.mssqltips.com/sqlservertip/2696/comparing-performance-for-different-sql-server-paging-methods/http://msdn.microsoft.com/en-us/library/ms188385.aspxhttp://msdn.microsoft.com/en-us/library/ms180152.aspxhttp://msdn.microsoft.com/en-us/library/ms186243.aspxhttp://msdn.microsoft.com/en-us/library/ms186734.aspx

Page 264: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

http://www.sqlserver-training.com/how-to-use-offset-fetch-option-in-sql-server-order-by-clause/-http://www.sqlservercentral.com/blogs/juggling_with_sql/2011/11/30/using-offset-and-fetch/

QUESTION 70Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe 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

Page 265: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Product.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Dynamic.sql

Page 266: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

CategoryFromType.sql

IndexManagement.sql

Page 267: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify Production.ProductDetails_Insert to comply with the application requirements.Which code segment should you execute?

A. ADD SIGNATURE TO Production.ProductDetails_InsertBY CERTIFICATE PRODUCTSCERT;

B. OPEN DBCERT;ALTER PROCEDURE Production. ProductDetails_InsertWITH ENCRYPTION;CLOSE D3CERT;

C. ADD SIGNATURE TO Production.ProductDetails_InsertBY CERTIFICATE DBCERT;

Page 268: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

D. OPEN PRODUCTSCERT;ALTER PROCEDURE Production. ProductDetails_InsertWITH ENCRYPTION;CLOSE PRODUCTSCERT;

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/bb669102.aspx

QUESTION 71Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe 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.

Page 269: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Page 270: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Dynamic.sql

CategoryFromType.sql

IndexManagement.sql

Page 271: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to create a function that will use a SELECT statement in ProductsByProductType.sql. Which codesegment should you use to complete the function?

A. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))RETURNS @tblInvoices TABLE (ProductID bigint, Produ ctType varchar(11),CreationDate date)AS

B. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))RETURNS xmlAS RETURN

Page 272: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

C. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))RETURNS @tblInvoices TABLE (ProductID bigint, Produ ctType varchar(11),CreationDate date)AS INSERT INTO @tblInvoices

D. CREATE FUNCTION Production.fnProductsByProductType (@ProductType varchar(11))RETURNS TABLEAS RETURN

Correct Answer: DSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms191320.aspxhttp://msdn.microsoft.com/en-us/library/ms186755.aspx

QUESTION 72Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe planned database has the following requirements:

All stored procedures must be signed.The amount of disk space must be minimized.

Page 273: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Page 274: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Dynamic.sql

CategoryFromType.sql

IndexManagement.sql

Page 275: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou are planning the ManufacturingSteps table. You need to define the ProductID column in the CREATETABLE statement. Which code segment should you use?

A. ProductID bigint FOREIGN KEY REFERENCESProduction.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 K EY REFERENCES

Page 276: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Production.Product(ProductID),

D. ProductID bigint DEFAULT((NEXT VALUE FOR Production.ProductID_Seq OVER(ORDER BY ManufacturingStepID))) NOT NULL,

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms189049.aspxhttp://msdn.microsoft.com/en-us/library/ms179610.aspxhttp://msdn.microsoft.com/en-us/library/ff878370.aspx

QUESTION 73Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe 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.

Page 277: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Page 278: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Dynamic.sql

CategoryFromType.sql

IndexManagement.sql

Page 279: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to prepare the database to use the .NET Framework ProcessProducts component. Which codesegments should you execute? (Each correct answer presents part of the solution. Choose all that apply.)

A. CREATE ASSEMBLY ProductionAssembly FROM 'C:\Product s\ProcessProducts.DLL';

B. EXEC sp_recompile @objname = 'Production.ProcessPro duct';

C. RECONFIGURE;

D. EXEC sp_configure 'clr enabled', '1';

E. CREATE ASSEMBLY ProductionAssembly FROM 'C:\Product s\ProcessProducts.cs';

F. CREATE PROCEDURE Production.ProcessProduct( @ProductID int, @ProductType varchar(11)

Page 280: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

) AS EXTERNAL NAME ProductionAssembly.ProcessProduct .Process;

G. CREATE TYPE Production.ProcessProductEXTERNAL NAME ProductionAssembly.ProcessProducts.Pr ocess;

Correct Answer: ACDFSection: (none)Explanation

Explanation/Reference:According to the reference, this answer looks correct.

Reference: http://msdn.microsoft.com/en-us/library/ms131048.aspxhttp://msdn.microsoft.com/en-us/library/ms131052.aspxhttp://msdn.microsoft.com/en-us/library/ms189524.aspxhttp://msdn.microsoft.com/en-us/library/ms345106.aspxhttp://msdn.microsoft.com/en-us/library/ms131107.aspx

QUESTION 74Case Study 5: Manufacturing CompanyApplication InformationYou are a database administrator for a manufacturing company. You have an application that stores productdata. The data will be converted to technical diagrams for the manufacturing process. The product details arestored in XML format. Each XML must contain only one product that has a root element named Product. Aschema 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 namedProcessProduct that has a method name of Convert(). ProcessProducts.dll was created by using a source codefile named ProcessProduct.es. All of the files are located in C:\Products\. The application has severalperformance and security issues. You will create a new database named ProductsDB on a new server that hasSQL Server 2012 installed. ProductsDB will support the application. The following graphic shows the plannedtables for ProductsDB:

You will also add a sequence named Production.ProductID_Seq. You plan to create two certificates namedDBCert and ProductsCert. You will create ProductsCert in master. You will create DBCert in ProductsDB. Youhave an application that executes dynamic T-SQL statements against ProductsDB. A sample of the queriesgenerated by the application appears in Dynamic.sql.

Application RequirementsThe 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.

Page 281: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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.xmlAll product types are 11 digits. The first five digits of the product id reference the category of the product andthe remaining six digits are the subcategory of the product. The following is a sample customer invoice in XMLformat:

ProductsByProductType.sql

Page 282: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Dynamic.sql

CategoryFromType.sql

IndexManagement.sql

Page 283: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to implement Transparent Data Encryption (TDE) on ProductsDB. Which code segment should youuse?

A. USE PRODUCTSDB;GOCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = TRIPLE_DES_3KEYENCRYPTION BY SERVER CERTIFICATE DBCERT;GOALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;GO

B. USE PRODUCTSDB;

Page 284: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

GOCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = TRIPLE_DES_3KEYENCRYPTION BY SERVER CERTIFICATE PRODUCTSCERT;GOALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;GO

C. USE PRODUCTSDB;GOCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256ENCRYPTION BY SERVER CERTIFICATE PRODUCTSCERT;GOALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;GO

D. USE PRODUCTSDB;GOCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256ENCRYPTION BY SERVER CERTIFICATE DBCERT;GOALTER DATABASE PRODUCTSDB SET ENCRYPTION ON;GO

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Reference:http://msdn.microsoft.com/en-us/library/bb934049.aspx

QUESTION 75Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 285: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 286: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 287: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 288: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to provide referential integrity between the Sessions table and Speakers table. Which code segmentshould you add at line 47 of Tables.sql?

Page 289: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. ALTER TABLE dbo.Sessions ADD CONSTRAINTFK_Sessions_Speakers FOREIGN KEY (SessionID)REFERENCES dbo.Speakers (SpeakerID);

B. ALTER TABLE dbo.Speakers ADD CONSTRAINTFK_Speakers_Sessions FOREIGN KEY (SessionID)REFERENCES dbo.Sessions (SessionID);

C. ALTER TABLE dbo.Sessions ADD CONSTRAINTFK_Sessions_Speakers FOREIGN KEY (SpeakerID)REFERENCES dbo.Speakers (SpeakerID);

D. ALTER TABLE dbo.Speakers ADD CONSTRAINTFK_Speakers_Sessions FOREIGN KEY (SpeakerID)REFERENCES dbo.Sessions (SessionID);

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms189049.aspxhttp://msdn.microsoft.com/en-us/library/ms179610.aspxhttp://msdn.microsoft.com/en-us/library/ff878370.aspx

QUESTION 76Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 290: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 291: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 292: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 293: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to add a new column named Confirmed to the Attendees table. The solution must meet the followingrequirements:

Page 294: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Have a default value of false.Minimize the amount of disk space used.

Which code block should you use?

A. ALTER TABLE AttendeesADD Confirmed bit DEFAULT 0;

B. ALTER TABLE AttendeesADD Confirmed char(1) DEFAULT '0';

C. ALTER TABLE AttendeesADD Confirmed char(1) DEFAULT '1';

D. ALTER TABLE AttendeesADD Confirmed bit DEFAULT 1;

Correct Answer: ASection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

Reference: http://msdn.microsoft.com/en-us/library/ms177603.aspx

QUESTION 77Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 295: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 296: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 297: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 298: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou are evaluating the table design to support a rewrite of usp_AttendeesReport. You need to recommend achange to Tables.sql that will help reduce the amount of time it takes for usp_AttendeesReport to execute.

Page 299: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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

A. FullName AS (FirstName + ' ' + LastName),

B. FullName nvarchar(100) NOT NULL DEFAULT (dbo.Create FullName(FirstName,LastName)),

C. FullName AS (FirstName + ' ' + LastName) PERSISTED,

D. FullName nvarchar(100) NOT NULL CONSTRAINT DF_FullN ame DEFAULT(dbo.CreateFullName (FirstName, LastName)),

Correct Answer: CSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms188300.aspxhttp://msdn.microsoft.com/en-us/library/ms191250.aspx

QUESTION 78Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 300: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 301: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 302: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 303: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou need to modify usp_SelectSpeakersByName to support server-side paging. The solution must minimizethe amount of development effort required. What should you add to usp_SelectSpeakersByName?

Page 304: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

A. a table variableB. an OFFSET-FETCH clauseC. the ROWNUMBER keywordD. a recursive common table expression

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to these references, this answer looks correct.

References:http://www.mssqltips.com/sqlservertip/2696/comparing-performance-for-different-sql-server-paging-methods/http://msdn.microsoft.com/en-us/library/ms188385.aspxhttp://msdn.microsoft.com/en-us/library/ms180152.aspxhttp://msdn.microsoft.com/en-us/library/ms186243.aspxhttp://msdn.microsoft.com/en-us/library/ms186734.aspxhttp://www.sqlserver-training.com/how-to-use-offset-fetch-option-in-sql-server-order-by-clause/-http://www.sqlservercentral.com/blogs/juggling_with_sql/2011/11/30/using-offset-and-fetch/

QUESTION 79Case Study 6: Database Application ScenarioApplication InformationYou have two servers named SQL1 and SQL2 that have SQL Server 2012 installed. You have an applicationthat is used to schedule and manage conferences. Users report that the application has many errors and isvery slow. You are updating the application to resolve the issues. You plan to create a new database on SQL1to support the application. A junior database administrator has created all the scripts that will be used to createthe 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 inStoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown inIndexes.sql. (Line numbers are included for reference only.) A database named DB2 resides on SQL2. DB2has a table named SpeakerAudit that will audit changes to a table named Speakers. A stored procedure namedusp_UpdateSpeakersName will be executed only by other stored procedures. The stored procedures executingusp_UpdateSpeakersName will always handle transactions. A stored procedure namedusp_SelectSpeakersByName will be used to retrieve the names of speakers. Usp_SelectSpeakersByName canread uncommitted data. A stored procedure named usp_GetFutureSessions will be used to retrieve sessionsthat will occur in the future.

Procedures.sql

Page 305: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part
Page 306: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Indexes.sql

Page 307: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

Tables.sql

Page 308: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

------------QuestionYou execute usp_TestSpeakers. You discover that usp_SelectSpeakersByName uses inefficient executionplans. You need to update usp_SelectSpeakersByName to ensure that the most efficient execution plan is

Page 309: Transition Your MCITP: Database Administrator 2008 or MCITP: … · 2013-02-15 · OF triggers, see DML Triggers. Partitioned Views ... the select_statement must include the two-part

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)

Correct Answer: BSection: (none)Explanation

Explanation/Reference:According to this reference, this answer looks correct.

References:http://msdn.microsoft.com/en-us/library/ms181714.aspx

http://www.gratisexam.com/