• You could put some control flow in your procedure, so that if a value for @top is passed, it used, but if it's null, the query is executed without the TOP clause.

    John