Du kan prøve det andet format for sagserklæringen
CASE WHEN Product.type_id = 10
THEN
(
Select Statement
)
ELSE
(
Other select statement
)
END
FROM Product
WHERE Product.product_id = $pid
Se http://msdn.microsoft.com/en-us/library/ ms181765.aspx for mere information.