How should you complete the stored procedure?

HOTSPOT
You are maintaining statistics for a database table named tbiTransaction. The table contains more than 10 million records.
You need to create a stored procedure that meets the following requirements:
– On weekdays, update statistics for a sample of the total number of records in the table.
– On weekends, update statistics by sampling all rows in the table.
A maintenance task will call this stored procedure daily.
How should you complete the stored procedure? To answer, select the appropriate Transact-SOL segments in the answer area. NOTE: Each correct selection is worth one point.

image140 - 
How should you complete the stored procedure?

Answer:

image142 - 
How should you complete the stored procedure?

Which four Transact-SOL segments should you use to develop the solution?

DRAG DROP
You have a database that contains three encrypted store procedures named dbo.Procl, dbo.Proc2 and dbo.Proc3. The stored procedures include INSERT, UPDATE, DELETE and BACKUP DATABASE statements.
You have the following requirements:
– You must run all the stored procedures within the same transaction.
– You must automatically start a transaction when stored procedures include DML statements.
– You must not automatically start a transaction when stored procedures include DDL statements.
You need to run all three stored procedures.
Which four Transact-SOL segments should you use to develop the solution? To answer, move the appropriate Transact-SOL segments to the answer area and arrange then in the correct order.

image067 - Which four Transact-SOL segments should you use to develop the solution?

Answer:

image069 - Which four Transact-SOL segments should you use to develop the solution?

In which order should you arrange the Transact-SOL segments to develop the solution?

DRAG DROP
You have a database named MyDatabase. You must monitor all the execution plans in XML format by using Microsoft SQL Trace.
The trace must meet the following requirements:
– Capture execution plans only for queries that run the MyDatabase database.
– Filter out plans with event duration of less than or equal to 100 microseconds.
– Save trace results to a disk on the server.
You need to create the trace.
In which order should you arrange the Transact-SOL segments to develop the solution? To answer, move all Transact-SOL segments to the answer area and arrange them in the correct order.
NOTE: More than one order of answer choices is correct. You will receive credit for any of the correct orders you select.
DECLARE @traceEventld int = 122;
DECLARE @traceColumnldForTextData int = 1;
DECLARE @duration Filter bigint = 100
DECLARE @databaseID int;
SELECT @databaseld = DB_ID (‘MyDatabase’);

image144 - In which order should you arrange the Transact-SOL segments to develop the solution?

Answer:

image146 - In which order should you arrange the Transact-SOL segments to develop the solution?

What should you do?

You are a database developer for a company. The company has a server that has multiple physical disks. The disks are not part of a RAID array. The server hosts three Microsoft SQL Server instances.
There are many SQL jobs that run during off-peak hours. You must monitor the SQL Server instances in real time and optimize the server to maximize throughput, response time, and overall SQL performance. You need to create a baseline set of metrics to report how the computer running SQL Server operates under normal load. The baseline must include the resource usage associated with the server processes.
What should you do?
A. A. Create a sys.dm_os_waiting_tasks query.
B. Create a sys.dm_exec_sessions query.
C. Create a Performance Monitor Data Collector Set.
D. Create a sys.dm_os_memory_objects query.
E. Create a sp_configure ‘max server memory’ query.
F. Create a SQL Profiler trace.
G. Create asys.dm_os_wait_stats query.
H. Create an Extended Event.

Answer: D

How should you complete the relevant Transact-SOL statement? To answer?

Notify the sales person who places an order whether or not the order was completed.
You must add the following constraints to the SalesHistory table:
– a constraint on the SaleID column that allows the field to be used as a record identifier
– a constant that uses the ProductID column to reference the Product column of the ProductTypes table
– a constraint on the CategoryID column that allows one row with a null value in the column
– a constraint that limits the Sale Price column to values greater than four Finance department users must be able to retrieve data from the SalesHistory table for sales persons where the value of the SalesYTD column is above a certain threshold.
You plan to create a memory-optimized table named SalesOrder.
The table must meet the following requirements:
– The table must hold 10 million unique sales orders.
– The table must use checkpoints to minimize 1/0 operations and must not use transaction logging.
– Data loss is acceptable.
Performance for queries against the SalesOrder table that use where clauses with exact equality operations must be optimized.
You need to enable referential integrity for the ProductReview table.
How should you complete the relevant Transact-SOL statement? To answer? Select the appropriate Transact-SOL segments in the answer area.

image035 - 
How should you complete the relevant Transact-SOL statement? To answer?
Select two alternatives.
A. For the first selection select: WITH CHECK
B. For the first selection select: WITH NOCHECK
C. For the second selection select: ON DELETE NO ACTION ON UPDATE CASCADE
D. For the second selection select: ON DELETECASCADE ON UPDATE CASCADE
E. For the second selection select: ON DELETE NO ACTION ON UPDATE NO ACTION
F. For the second selection select: ON DELETE CASCADE ON UPDATE NO ACTION

Answer: B,C

What should you create?

You are developing an application to track customer sales.
You need to create a database object that meets the following requirements:
– Return a value of 0 if data inserted successfully into the Customers table.
– Return a value of 1 if data is not inserted successfully into the Customers table.
– Support logic that is written by using managed code.
What should you create?
A. extended procedure
B. CLR procedure
C. user-defined procedure
D. DML trigger
E. DDL trigger
F. scalar-valued function
G. table-valued function

Answer: B

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-SOL statement:

image178 - 
Does the solution meet the goal?
Does the solution meet the goal?
A. Yes
B. No

Answer: B

Which performance counter should you use for each requirement?

DRAG DROP
You are analyzing the memory usage of a Microsoft SQL Server instance.
You need to obtain the information described on the following table.

image134 - Which performance counter should you use for each requirement?
Which performance counter should you use for each requirement? To answer, drag the appropriate performance counters to the correct requirements. Each performance counter may be used once, more than once or not at all. You may need to drag the split bat between panes or scroll to view content.
NOTE: Each correct selection is worth one point.

image136 - Which performance counter should you use for each requirement?

Answer:

image138 - Which performance counter should you use for each requirement?

What should you do?

You are a database developer for a company. The company has a server that has multiple physical disks. The disks are not part of a RAID array. The server hosts three Microsoft SQL Server instances.
There are many SQL jobs that run during off-peak hours. You observe that many deadlocks appear to be happening during specific times of the day. You need to monitor the SQL environment and capture the information about the processes that are causing the deadlocks.
What should you do?
A. A. Create a sys.dm_os_waiting_tasks query.
B. Create a sys.dm_exec_sessions query.
C. Create a PerformanceMonitor Data Collector Set.
D. Create a sys.dm_os_memory_objects query.
E. Create a sp_configure ‘max server memory’ query.
F. Create a SQL Profiler trace.
G. Create a sys.dm_os_wait_stats query.
H. Create an Extended Event.

Answer: F

Which three Transact_SQL segments should you use to develop the solution?

Contains all of the columns required by the SELECT statement.
Which three Transact_SQL segments should you use to develop the solution? To answer, move the appropriate code blocks from the list of code blocks to the answer area and arrange them in the correct order.

image097 - 
Which three Transact_SQL segments should you use to develop the solution?

Answer:

image099 - 
Which three Transact_SQL segments should you use to develop the solution?