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.