IF EXISTS ( SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'repasse' )
BEGIN
	INSERT INTO repasse ( tipo, incidencia, forma, vlrnovo, vlrrenovacao, ativo, idvendedor ) SELECT 2, 1, 1, 0, 0, 1, v.idvendedor FROM vendedor v	LEFT OUTER JOIN repasse r ON r.idvendedor = v.idvendedor WHERE v.corretora = '1' AND r.idrepasse IS NULL;
END