Which Transact-SQL statement should you use?
You use Microsoft SQL Server 2012 to develop a database application. You create a stored procedure named
dbo.ModifyData that can modify rows. You need to ensure that when the transaction fails, dbo.ModifyData
meets the following requirements:
Does not return an error
Closes all opened transactions
Which Transact-SQL statement should you use?
You need to ensure that throughout the transaction the data maintains the originalversion
You are developing a database application by using Microsoft SQL Server 2012. An application that usesa
database begins to run slowly. You discover that during reads, the transaction experiences blocking from
concurrent updates. You need to ensure that throughout the transaction the data maintains the originalversion.
What should you do?
You need to capture executionplans that will include detailed information on missing indexes recommended by th
You are developing a database application by using Microsoft SQL Server 2012. You have a query that runs
slower than expected. You need to capture executionplans that will include detailed information on missing
indexes recommended by the query optimizer. What should you do?
You need to reduce procedure cacheusage from these statements without creating any additional indexes
You are developing a database application by using Microsoft SQL Server 2012. An application that usesa
database begins to run slowly. You discover that a large amount of memory is consumed by single-use
dynamic queries. You need to reduce procedure cacheusage from these statements without creating any
additional indexes. What should you do?
You need to optimize the statement
You are developing a database application by using Microsoft SQL Server 2012. An application that usesa
database begins to run slowly. Your investigation shows the root cause is a query against a read-only table that
has a clustered index. The query returns the following six columns:
One column in its WHERE clause contained in a non-clustered index Four additional columns
One COUNT (*) column based on a grouping of the four additional columns You need to optimize the
statement.
What should you do?
Which Transact-SQL query should you use?
You administer a Microsoft SQL Server 2012 databasenamed ContosoDb. Tables are defined as shown in the
exhibit. (Refer to the Exhibit.)
You need to display rows from the Orders table for the Customers row having the CustomerId value set to 1 in
the following XML format.
Which Transact-SQL query should you use?
Which Transact-SQL query should you use?
You administer a Microsoft SQL Server 2012 databasenamed ContosoDb. Tables are defined as shown in the
exhibit. (Refer to the Exhibit.)
You need to display rows from the Orders table for the Customers row having the Customerld value set to 1 in
the following XML format.
Which Transact-SQL query should you use?
Which isolation level should you use?
You use Microsoft SQL Server 2012 to write code fora transaction that contains several statements. There is
high contention between readers and writers on several tables used by your transaction. You need to minimize
the use of the tempdb space. You also need to prevent reading queries from blocking writing queries. Which
isolation level should you use?
Which Transact-SQL queryshould you use?
You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for
students. The table has marks obtained by 50 students for various subjects. You need to ensure that the top
half of the students arranged by their average marks must be given a rank of 1 and the remaining students
must be given a rank of 2. Which Transact-SQL queryshould you use?
Which Transact-SQL query should you use?
You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for
students. The table has marks obtained by 50 students for various subjects. You need to ensure that the
following requirements are met:
Students must be ranked based on their average marks.
If one or more students have the same average, the same rank must be given to these students.
Consecutive ranks must be skipped when the same rank is assigned.
Which Transact-SQL query should you use?