We obtain sharp asymptotic estimates on the number of $n times n$ contingency tables with two linear margins $Cn$ and $BCn$. The results imply a second order phase transition on the number of such contingency tables, with a critical value at ts $B_{c}:=1 + sqrt{1+1/C}$. As a consequence, for ts $B>B_{c}$, we prove that the classical emph{independence heuristic} leads to a large undercounting.