The vertical asymptote is a value of x at which the denominator of the function gives 0.
The vertical asymptote is a line on the graph that is not intersected by the curve of function at any point as at that value function is not defined.
So x = 2 is vertical asymptote only if denominator of function gives 0 for that value of x.