In this paper, we propose a stochastic SIR epidemic model with vertical transmission and varying total population size. Firstly, we prove the existence and uniqueness of the global positive solution for the stochastic model. Secondly, we establish three thresholds lambda(1), lambda(2 )and lambda(3 )of the model. The disease will die out when lambda(1) < 0 and lambda(2) < 0, or lambda(1) > 0 and lambda(3) < 0, but the disease will persist when lambda(1) < 0 and lambda(2) > 0, or lambda(1) > 0 and lambda(3) > 0 and the law of the solution converge to a unique invariant measure. Moreover, we find that when lambda(1) < 0 some stochastic perturbations can increase the threshold lambda(2), while others can decrease the threshold lambda(2). That is, some stochastic perturbations enhance the spread of the disease, but others are just the opposite. On the other hand, when lambda(1) > 0, some stochastic perturbations increase or decrease the threshold lambda(3) with different parameter sets. Finally, we give some numerical examples to illustrate obtained results.