Let's say what you're asking for is the standard error of the estimation of the proportion defective, and that these can be represented as independent draws from a binomial distribution.
This standard error is $\sqrt{\frac{p(1-p)}{n}}$ where $p$ is the measured proportion defective. For 95 % one-sided confidence, we want to see a measurement at least 1.645 standard errors away from 2 %. Thus, the full equation we want to solve is
$$p + 1.645\sqrt{\frac{p(1-p)}{n}} = 0.02.$$
As you can see, the sample size required actually depends on what proportion defective you expect to find. Here are some examples:
- p = 0.5 %, n = 60
- p = 1.0 %, n = 268
- p = 1.5 %, n = 1600
- p = 1.8 %, n = 11958
As you can probably intuit, the closer the observed proportion is to 2 %, the more data you need to be really sure it's not greater than 2 %.
Note that this assumes the total population is practically infinite. You haven't specified the size exactly, but once you're sampling a significant proportion of the entire population (If you're doing non-destructive testing, anyway) you get a bonus to the standard error that's roughly the equivalent of multiplying by (N-n)/N.
However, this would only kick in once you have a really huge sample anyway, and the asymptote is still inspecting the entire population, so I'm not sure how much that helps you.
For more on this type of sampling for proportion defective, Deming wrote a lot about it in his books on sampling and statistics, as that was a big part of what he worked on.
(In particular, when doing destructive testing, depending on how lots are drawn, etc, you can have funny effects where discovering a large number of defective in the sample means there are fewer defective going to the customer.)