Skip to content

OPTION

SELECT ProductID, Name
FROM Production.Product
ORDER BY ListPrice DESC
OPTION (MAXDOP 1);
ProductID | Name
--------- | -------------
748 | Road-150 Red, 62
749 | Road-150 Red, 44
750 | Road-150 Red, 48
751 | Road-150 Red, 52
752 | Road-150 Red, 56
753 | Road-150 Red, 60

The OPTION clause is used to optimize the performance of your SQL Server query. In this example, the MAXDOP 1 option ensures that the query uses only one processor for its execution, potentially improving performance for a system with multiple processors. The query selects ProductID and Name from the Production.Product table, ordered by ListPrice in descending order.