Microsoft 70-762 Actual Free Exam Questions & Community Discussion
You suspect deadlocks on a database.
Which two trace flags in the Microsoft SQL Server error log should you locate? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Which two trace flags in the Microsoft SQL Server error log should you locate? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Correct Answer: C,E
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have a database that is 130 GB and contains 500 million rows of data.
Granular transactions and mass batch data imports change the database frequently throughout the day.
Microsoft SQL Server Reporting Services (SSRS) uses the database to generate various reports by using several filters.
You discover that some reports time out before they complete.
You need to reduce the likelihood that the reports will time out.
Solution: You increase the number of log files for the database. You store the log files across multiple disks.
Does this meet the goal?
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have a database that is 130 GB and contains 500 million rows of data.
Granular transactions and mass batch data imports change the database frequently throughout the day.
Microsoft SQL Server Reporting Services (SSRS) uses the database to generate various reports by using several filters.
You discover that some reports time out before they complete.
You need to reduce the likelihood that the reports will time out.
Solution: You increase the number of log files for the database. You store the log files across multiple disks.
Does this meet the goal?
Correct Answer: B
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Note: This question is part of a series of questions that present the same scenario. Each question in this series contains a unique solution. Determine whether the solution meets the stated goals.
Your company has employees in different regions around the world.
You need to create a database table that stores the following employee attendance information:
- Employee ID
- date and time employee checked in to work
- date and time employee checked out of work
Date and time information must be time zone aware and must not store fractional seconds.
Solution: You run the following Transact-SQL statement:

Does the solution meet the goal?
Your company has employees in different regions around the world.
You need to create a database table that stores the following employee attendance information:
- Employee ID
- date and time employee checked in to work
- date and time employee checked out of work
Date and time information must be time zone aware and must not store fractional seconds.
Solution: You run the following Transact-SQL statement:

Does the solution meet the goal?
Correct Answer: B
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
You have a Microsoft Azure SQL database.
Some queries take a long time to execute.
You need to identify whether any of the long-runffiing queries prevent users from updating data in the database.
Which query should you execute? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Some queries take a long time to execute.
You need to identify whether any of the long-runffiing queries prevent users from updating data in the database.
Which query should you execute? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Correct Answer:

Explanation

Box 1: sys.dm_tran_locks
sys.dm_tran_locks returns information about currently active lock manager resources in SQL Server 2017.
Each row represents a currently active request to the lock manager for a lock that has been granted or is waiting to be granted.
Box 2: sys.dm_os_waiting_tasks
sys.dm_tran_locks.lock_owner_address is the memory address of the internal data structure that is used to track this request. This column can be joined the with resource_address column in sys.dm_os_waiting_tasks.
References:
https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-tran-locks
You manage a database with tables named Invoice and InvoiceDetails. Each invoice may have multiple records.
Users update the InvoiceDetails table by using a .NET web application. The application retrieves records from both tables and updates the tables by running an inline update statement.
Users experience slow performance when updating records in the application. The solution must meet the following requirements:
* Must use a stored procedure.
* Must not use inline update statements
* Must use a table-valued parameter.
* Must call the stored procedure to update all records.
You need to optimize performance.
Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.

Users update the InvoiceDetails table by using a .NET web application. The application retrieves records from both tables and updates the tables by running an inline update statement.
Users experience slow performance when updating records in the application. The solution must meet the following requirements:
* Must use a stored procedure.
* Must not use inline update statements
* Must use a table-valued parameter.
* Must call the stored procedure to update all records.
You need to optimize performance.
Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.

Correct Answer:

Explanation

Box 1: Create a user-defined table type...
Table-valued parameters are declared by using user-defined table types. You can use table-valued parameters to send multiple rows of data to a Transact-SQL statement or a routine, such as a stored procedure or function, without creating a temporary table or many parameters.
Box 2: ..read-only input parameter.
Table-valued parameters must be passed as input READONLY parameters to Transact-SQL routines.
Box 3:
Example
The following example uses Transact-SQL and shows you how to create a table-valued parameter type, declare a variable to reference it, fill the parameter list, and then pass the values to a stored procedure.
USE AdventureWorks2012;
/* Create a table type. */
CREATE TYPE LocationTableType AS TABLE
( LocationName VARCHAR(50)
, CostRate INT );
GO
/* Create a procedure to receive data for the table-valued parameter. */ CREATE PROCEDURE dbo. usp_InsertProductionLocation
@TVP LocationTableType READONLY
Etc.
/* Declare a variable that references the type. */
DECLARE @LocationTVP AS LocationTableType;
/* Add data to the table variable. */
INSERT INTO @LocationTVP (LocationName, CostRate)
SELECT Name, 0.00
FROM AdventureWorks2012.Person.StateProvince;
/* Pass the table variable data to a stored procedure. */
EXEC usp_InsertProductionLocation @LocationTVP;
GO
References:
https://docs.microsoft.com/en-us/sql/relational-databases/tables/use-table-valued-parameters-database-engine?vie
You are performing a code review for Transact-SQL statements.
What action does the constraint in each statement perform? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

What action does the constraint in each statement perform? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Correct Answer:


You have a Microsoft Azure SQL Database. You enable Query Store for the database and configure the store to use the following settings:
SIZE_BASE_CLEANUP_MODE= OFF
STATE_QUERY_THRESHOLD_DAYS =60
MAX_STORAGE_SIZE= 100
QURRY_CAPTURE _MODE =ALL
You use Azure performance insight to receive queries. You observer that new queries are not displayed after
15 days and that the QUEY Store us set to read-only mode.
If the Query Store runs low on data pace, the store must prioritize queries from the regularly or queries that consume significant resources.
You set the Query Store to read_write mode and determine the performance of queries from the past 60 days.
Which three statements should you perform? Each correct step presents part of the solution.
NOTE: Each selection is worth one point.
SIZE_BASE_CLEANUP_MODE= OFF
STATE_QUERY_THRESHOLD_DAYS =60
MAX_STORAGE_SIZE= 100
QURRY_CAPTURE _MODE =ALL
You use Azure performance insight to receive queries. You observer that new queries are not displayed after
15 days and that the QUEY Store us set to read-only mode.
If the Query Store runs low on data pace, the store must prioritize queries from the regularly or queries that consume significant resources.
You set the Query Store to read_write mode and determine the performance of queries from the past 60 days.
Which three statements should you perform? Each correct step presents part of the solution.
NOTE: Each selection is worth one point.
Correct Answer: A,C,D
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Note: This question is part of a series of questions that use the same or similar answer choices. As answer choice may be correct for more than one question in the series. Each question is independent of the other questions in this series.
Information and details provided in a question apply only to that question.
You have a Microsoft SQL Server database named DB1 that contains the following tables:

Users frequently run the following query:

Users report that the query takes a long time to return results.
You need to minimize the amount of time requires for the query to return data.
What should you do?
Information and details provided in a question apply only to that question.
You have a Microsoft SQL Server database named DB1 that contains the following tables:

Users frequently run the following query:

Users report that the query takes a long time to return results.
You need to minimize the amount of time requires for the query to return data.
What should you do?
Correct Answer: F
Vote an answer
You have multiple queries that take a long time to complete.
You need to identify the cause by using detailed information about the Transact-SQL statements in the queries. The Transact-SQL statements must not run as part of the analysis.
Which Transact-SQL statement should you run?
You need to identify the cause by using detailed information about the Transact-SQL statements in the queries. The Transact-SQL statements must not run as part of the analysis.
Which Transact-SQL statement should you run?
Correct Answer: C
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
Note: This question is part of a series of questions that present the same scenario. Each question in this series contains a unique solution. Determine whether the solution meets the stated goals.
The Account table was created by using the following Transact-SQL statement:

There are more than 1 billion records in the Account table. The Account Number column uniquely identifies each account. The ProductCode column has 100 different values. The values are evenly distributed in the table. Table statistics are refreshed and up to date.
You frequently run the following Transact-SQL SELECT statements:

You must avoid table scans when you run the queries.
You need to create one or more indexes for the table.
Solution: You run the following Transact-SQL statement:

Does the solution meet the goal?
The Account table was created by using the following Transact-SQL statement:

There are more than 1 billion records in the Account table. The Account Number column uniquely identifies each account. The ProductCode column has 100 different values. The values are evenly distributed in the table. Table statistics are refreshed and up to date.
You frequently run the following Transact-SQL SELECT statements:

You must avoid table scans when you run the queries.
You need to create one or more indexes for the table.
Solution: You run the following Transact-SQL statement:

Does the solution meet the goal?
Correct Answer: B
Vote an answer
Explanation: Only visible for EduDump members. You can sign-up / login (it's free).
You have two database tables. Table1 is a partitioned table and Table 2 is a non-partitioned table.
Users report that queries take a long time to complete. You monitor queries by using Microsoft SQL Server Profiler. You observe lock escalation for Table1 and Table 2.
You need to allow escalation of Table1 locks to the partition level and prevent all lock escalation for Table2.
Which Transact-SQL statement should you run for each table? To answer, drag the appropriate Transact-SQL statements to the correct tables. Each command may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

Users report that queries take a long time to complete. You monitor queries by using Microsoft SQL Server Profiler. You observe lock escalation for Table1 and Table 2.
You need to allow escalation of Table1 locks to the partition level and prevent all lock escalation for Table2.
Which Transact-SQL statement should you run for each table? To answer, drag the appropriate Transact-SQL statements to the correct tables. Each command may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

Correct Answer:

Explanation

Since SQL Server 2008 you can also control how SQL Server performs the Lock Escalation - through the ALTER TABLE statement and the property LOCK_ESCALATION. There are 3 different options available:
Box 1: Table1, Auto
The default option is TABLE, means that SQL Server *always* performs the Lock Escalation to the table level -even when the table is partitioned. If you have your table partitioned, and you want to have a Partition Level Lock Escalation (because you have tested your data access pattern, and you don't cause deadlocks with it), then you can change the option to AUTO. AUTO means that the Lock Escalation is performed to the partition level, if the table is partitioned, and otherwise to the table level.
Box 2: Table 2, DISABLE
With the option DISABLE you can completely disable the Lock Escalation for that specific table.
For partitioned tables, use the LOCK_ESCALATION option of ALTER TABLE to escalate locks to the HoBT level instead of the table or to disable lock escalation.
References:
http://www.sqlpassion.at/archive/2014/02/25/lock-escalations/
You have a database named Database1.
Users report that they experience deadlock issues. You run the sp_readerlog stored procedure. You view the output from the Process List section as shown in the Process List exhibit. (Click the Process List tab.)

You view the contents of the Resource List section as shown in the Resource List exhibit. (Click the Resource List tab.)

You view deadlock information as shown in the Deadlock List exhibit. (Click the Deadlock List tab.)

You need to identify the causes of the deadlock.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Users report that they experience deadlock issues. You run the sp_readerlog stored procedure. You view the output from the Process List section as shown in the Process List exhibit. (Click the Process List tab.)

You view the contents of the Resource List section as shown in the Resource List exhibit. (Click the Resource List tab.)

You view deadlock information as shown in the Deadlock List exhibit. (Click the Deadlock List tab.)

You need to identify the causes of the deadlock.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Correct Answer:

Explanation

Box 1: No

The following three lock types are used for row- and page-level locking:
Shared (S)
Exclusive (X)
Update (U)
An exclusive lock reserves a page or row, but not a whole table, for the exclusive use of a single transaction.
Note: Read committed specifies that statements cannot read data that has been modified but not committed by other transactions.
Box 2: No
Taskpriority is 0, which is the default priority. The transaction could be chosen as the victim if other transactions have a priority higher than 0.

Box 3: Yes

References:
https://www.sqlshack.com/what-is-a-sql-server-deadlock/
https://logicalread.com/sql-server-lock-modes-mc03/#.XULCdm8zaUk
0
0
0
10
