• John Mitchell-245523 (2/17/2012)


    Got it right, but I think the answer should be "it depends". On what? The selectivity of the data in Col [...] Therefore, in the second case, there'd be no way of optimising the stored procedure.

    ALTER PROCEDURE dbo.QOD_Performance_1

    @Get VARCHAR(100)

    AS

    BEGIN

    SET NOCOUNT ON;

    SELECT ft.ID, ft.Col

    FROM dbo.FirstTable AS ft WITH (FORCESEEK)

    WHERE ft.Col = @Get;

    END;