adplus-dvertising
frame-decoration

Question

Which of the following query selects incremental inserts from the Sales.Customer table at the server?

a.

IF @sync_initialized == 0
SELECT Sales.Customer.[CustomerId], [CustomerName], [SalesPerson], [CustomerType]
FROM Sales.Customer LEFT OUTER JOIN
CHANGETABLE(CHANGES Sales.Customer, @sync_last_received_anchor) CT
ON CT.[CustomerId] = Sales.Customer.[CustomerId]
ELSE
BEGIN
SELECT Sales.Customer.[CustomerId], [CustomerName], [SalesPerson], [CustomerType]
FROM Sales.Customer JOIN CHANGETABLE(CHANGES Sales.Customer, @sync_last_received_anchor) CT
ON CT.[CustomerId] = Sales.Customer.[CustomerId]
WHERE (CT.SYS_CHANGE = 'I' AND CT.SYS_CHANGE_CREATION_VERSION
<= @sync_new_received_anchor)
END

b.

IF @sync_initialized = 0
SELECT Sales.Customer.[CustomerId], [CustomerName], [SalesPerson], [CustomerType]
FROM Sales.Customer LEFT OUTER JOIN
CHANGETABLE(CHANGES Sales.Customer, @sync_last_received_anchor) CT
ON CT.[CustomerId] = Sales.Customer.[CustomerId]
ELSE
BEGIN
SELECT Sales.Customer.[CustomerId], [CustomerName], [SalesPerson], [CustomerType]
FROM Sales.Customer JOIN CHANGETABLE(CHANGES Sales.Customer, @sync_last_received_anchor) CT
ON CT.[CustomerId] = Sales.Customer.[CustomerId]
WHERE (CT.SYS_CHANGE = 'I' AND CT.SYS_CHANGE_CREATION_VERSION
<= @sync_new_received_anchor)
END

c.

IF @sync_initialized =0
SELECT Sales.Customer.[CustomerId], [CustomerName], [SalesPerson], [CustomerType]
FROM Sales.Customer LEFT OUTER JOIN
CHANGETABLE(CHANGES Sales.Customer, @sync_last_received_anchor) CT
ON CT.[CustomerId] = Sales.Customer.[CustomerId]
ELSE
BEGIN
SELECT Sales.Customer.[CustomerId], [CustomerName], [SalesPerson], [CustomerType]
FROM Sales.Customer JOIN CHANGETABLE(CHANGES Sales.Customer, @sync_last_received_anchor) CT
ON CT.[CustomerId] = Sales.Customer.[CustomerId]
WHERE (CT.SYS_CHANGE_OPERATION = 'I' AND CT.SYS_CHANGE_CREATION_VERSION
<= @sync_new_received_anchor)
END

d.

None of the mentioned

Posted under SQL Server

Answer: (c).IF @sync_initialized =0
SELECT Sales.Customer.[CustomerId], [CustomerName], [SalesPerson], [CustomerType]
FROM Sales.Customer LEFT OUTER JOIN
CHANGETABLE(CHANGES Sales.Customer, @sync_last_received_anchor) CT
ON CT.[CustomerId] = Sales.Customer.[CustomerId]
ELSE
BEGIN
SELECT Sales.Customer.[CustomerId], [CustomerName], [SalesPerson], [CustomerType]
FROM Sales.Customer JOIN CHANGETABLE(CHANGES Sales.Customer, @sync_last_received_anchor) CT
ON CT.[CustomerId] = Sales.Customer.[CustomerId]
WHERE (CT.SYS_CHANGE_OPERATION = 'I' AND CT.SYS_CHANGE_CREATION_VERSION
<= @sync_new_received_anchor)
END

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following query selects incremental inserts from the Sales.Customer table at the server?

Similar Questions

Discover Related MCQs

Q. Point out the wrong statement.

Q. Which of the following code snippet returns a version integer that is associated with the last committed transaction that was tracked by change tracking?

Q. Which of the following is a valid syntax for WITH CHANGE_TRACKING_CONTEXT?

Q. _____________ obtains tracking information for all changes to a table that have occurred since a specific version.

Q. Which of the following is a catalog view used for change tracking?

Q. Which of the following feature distinguishes change data capture from change tracking?

Q. Which of the following script will enable CDC on HumanResources.Shift table?

Q. Point out the correct statement.

Q. Which of the following disable database for Change Data Capture?

Q. If you do not want to use a gating role, explicitly set the @role_name parameter to ______________

Q. Point out the wrong statement.

Q. Which of the following query determine sessions that had an empty scan?

Q. Which of the following script enable a table Without Using a Gating Role?

Q. Which of the following script enable a Table for all and Net Changes Queries?

Q. Upper bound on expected throughput of the capture job is calculated using which of the following computation?

Q. The cleanup job is initiated by running the parameterless stored procedure is ___________

Q. Which of the following error is returned for a query for all changes when a parameter that is used to define the query interval is not valid?

Q. Point out the correct statement.

Q. The commit time of each transaction with an associated entry in a database change table is available in the table __________

Q. Which of the code snippet collect the data every 5 minutes?