def add_rowcount_limit(sql, limit=300, delimeter=';'):
    """ Sets the rowcount limit.

    Can be used in lieue of adding a `TOP` clause for databases
    that support it.

    Args:
      sql (str): The sql statement.
      limit (int): The row number limit.
      delimiter (str): The sql statement delimeter.
    """
    return 'set rowcount {}{} {}'.format(limit, delimeter, sql)