views:

120

answers:

1

i want to run a query on multiple processors. what is the syntax to run a parallel query? please provide a sample query

+2  A: 

You don't: the optimizer decides based on the "cost" of the query (and some other factors)

See BOL: Parallel Query Processing

Now, you can limit parallelism with MAXDOP or change the cost threshold, but it's not something I'd do.

Why do you want to explicitly set this?

gbn
i know but i was checking this thread at msdn http://msdn.microsoft.com/en-us/library/ms175097.aspx they are showing an example of running a parallel query but i didnt get it
Microgen
They are showing a query which happens to be using parallelism at that time. The plan that they show is what the engine determined was best. They didn't do anything specific to cause it.
Tom H.