What is the result?

You are a database developer on an instance of SQL Server 2008. You have a Prod database that contains the following ProductDetails table:


You also have another table named ProductStaging, which contains the following data:


You execute the following statement:
MERGE ProductDetails AS t USING ProductStaging AS s ON (t.ProductID = s.ProductID)
WHEN MATCHED THEN UPDATE SET ModifiedDate = GETDATE(),Color = s.Color,Style = s.Style,ProductLine = s.ProductLine
WHEN NOT MATCHED THEN INSERT(ProductID, Name, ProductNumber, Color, ReorderPoint, Size, ProductLine, Style,
ModifiedDate)VALUES (s.ProductID, s.Name, s.ProductNumber, s.Color, 0, s.Size, s.ProductLine, s.Style, GETDATE())
OUTPUT INSERTED.*, $action;
What is the result?
A. If a row with a ProductID value of 720 does not exist in the ProductDetails table, the product is added to the ProductDetails table.
B. If a row with a ProductID value of 710 exists in the ProductDetails table, no action is taken.
C. If a row with a ProductID value of 800 exists in the ProductDetails, it is deleted.
D. If a row with a ProductID value of 713 exists in the ProductDetails table, it is updated only if the Color, Style, or ProductLine value is different.

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.