Which severity level should you use?
You are using TRY…CATCH error handling.
You need to raise an error that will pass control to the CATCH block.
Which severity level should you use?
Which TransactSQL statement should you insert at line 07?
You have a table named Orders. You have been tasked to modify your company’s main database to
remove all inactive order rows.
You are developing a stored procedure that will enable you to delete these rows. You have written
the
following code segment to accomplish this task. (Line numbers are included for reference only.)
01 BEGIN TRY
02 DECLARE @RowCount INT = 1000
03 WHILE @RowCount = 1000
04 BEGIN
05 DELETE TOP (1000) FROM Orders WHERE Status = ‘Inactive’Íž
06 SET @RowCount = @@ROWCOUNT
07 …
08 END
09 END TRY
10 BEGIN CATCH
11 PRINT ERROR_MESSAGE()
12 END CATCH
You need to insert a TransactSQL
statement that will notify you immediately after each batch of rows is
deleted. Which TransactSQL
statement should you insert at line 07?
Which transaction isolation level should you use?
You have a transaction that uses the repeatable read isolation level.
This transaction causes frequent blocking problems. You need to reduce blocking. You also need to
avoid dirty reads and nonrepeatable
reads. Which transaction isolation level should you use?
Which option should you enable?
You are writing a batch that contains multiple UPDATE statements to modify existing products. You
have placed these updates into one explicit transaction. You need to set an option at the beginning
of the transaction to roll back all changes if any of the updates in the transaction fail. Which option
should you enable?
Which query should you use?
You have a table named JobCandidate. You are tasked to delete a row in the JobCandidate table. You
need to write a transaction that allows the database to be restored to the exact point the record was
deleted without knowing the time of execution. Which query should you use?
Which query should you use?
You have the following table named Sales.
You need to return sales data ordered by customer name and date of sale. For each customer, the
most
recent sale must be listed first.
Which query should you use?
Which TransactSQL statement should you use?
You have a table named Sales.SalesOrderHeader and a table named Person.Person. You are tasked
to write a query that returns SalesOrderID and SalesPersonName that have an OrderDate greater
than
20040101. SalesPersonName should be made up by concatenating the columns named FirstName
and
LastName from the table named Person.Person. You need to write a query to return data, sorted in
alphabetical order, by the concatenation of FirstName and LastName.
Which TransactSQL
statement should you use?
Which TransactSQL statement should you use?
You have a table named Sales.PotentialClients. This table contains a column named EmailAddress.
You are tasked to develop a report that returns valid “.com” email addresses from
Sales.PotentialClients.
A valid email address must have at least one character before the @ sign, and one character after
the @
sign and before the “.com.”
You need to write a TransactSQL
statement that returns data to meet the business requirements.
Which TransactSQL
statement should you use?