By default, hash joins are enabled only at allrows_dss optgoal. To override the server level to allow use of hash join in a session or stored procedure, use set hash_join on.
To enable hash joins, use:
set hash_join on
To disable hash joins, use:
set hash_join off