Home Forums SQL Server 2008 SQL Server 2008 - General What is proper way of indexing on a table which contain large amount of data RE: What is proper way of indexing on a table which contain large amount of data

  • Hi Fritchey,

    We have made the SQL like this,

    IF @inbCityID IS NOT NULL AND @inbCityID > 0

    BEGIN

    SET @SqlCondition = @SqlCondition + ' AND vaa.CityID = ' + CONVERT(VARCHAR(50), @inbCityID);

    END

    (this is only a block of code)

    & Finally we use below code:

    EXECUTE SP_EXECUTESQL @FinalSql;

    Should I change above structure to parametrized structure & then I should pass the parameters to SP_EXECUTESQL.