Which query should you use?

You use Microsoft .NET Framework 4.0 to develop an application that uses Entity Framework.
The application includes the following Entity SQL (ESQL) query.

SELECT VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice

You need to modify the query to support paging of the query results. Which query should you use?

You use Microsoft .NET Framework 4.0 to develop an application that uses Entity Framework.
The application includes the following Entity SQL (ESQL) query.

SELECT VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice

You need to modify the query to support paging of the query results. Which query should you use?

A.
SELECT TOP Stop VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice
SKIP @skip

B.
SELECT VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice
SKIP @skip LIMIT @limit

C.
SELECT SKIP @skip VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice
LIMIT @limit

D.
SELECT SKIP @skip TOP Stop VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice

Explanation:
Entity SQL Reference
(http://msdn.microsoft.com/en-us/library/bb387118.aspx)

How to: Page Through Query Results
(http://msdn.microsoft.com/en-us/library/bb738702.aspx)



Leave a Reply 0

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