SQL Server Performance

Query processor could not produce a query plan

Discussion in 'SQL Server 2005 General Developer Questions' started by rupesh, Mar 24, 2008.

  1. rupesh New Member

    hello, I had a search query as mentioned below:
    select p.serial_number from products p
    left merge join
    (select distinct(serial_number) from rare_items) ri
    on ri.serial_number = p.serial_number
    where p.serial_number = 20
    when i run this query it gives the followgin error message:
    Msg 8622, Level 16, State 1, Line 1
    Query processor could not produce a query plan because of the hints defined in this query. Resubmit the query without specifying any hints and without using SET FORCEPLAN.
    If in the where clause i donot use serial_number then no any error message displayed.
    plz can anybody help me find out the root cause... and the best solution for this, i have no other options than using left merge join



  2. Luis Martin Moderator

    Welcome to the forum.[:)]
    What did you see if, instead run, you check execution plan?
  3. FrankKalis Moderator

    What service pack are you on?
  4. jagblue New Member

    can you try sub query with order by Serial_Number as merge join requires data to be sorted on both tables
  5. satya Moderator

Share This Page