SELECT 1 FROM SF_CP_Detail WITH(INDEX( IX_SF_CP_Detail_MAC1 )) WHERE SN <> '021SAG2SC5000101'
AND Mac1 between '00464B5CD761' AND '00464B5CD769' 放在存储过程中报这个错 消息 8622,级别 16,状态 1,过程 UProc_CheckMacUnique_T,第 22 行
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. MAC1是有唯一索引 ,在查询分析器里单独执行时不会报错,
将这句放到存储过程里执行就会报错. 将with(indx(IX_SF_CP_DETAIL_MAC1))这句去掉后都可以执行.但是在查询分析器和存储过程里使用不同的索引,导致存储过程里执行非常的慢,
请大家分析下是什么原因