Changing SQL  procedure to parameterized