IF EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='POS_CONNECT_BANDEIRA')
BEGIN

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 1)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(1, N'PIX');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 2)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(2, N'ALELO');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 3)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(3, N'AMERICANEXPRESS');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 4)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(4, N'AVANCARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 5)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(5, N'BANESCARD'); ;
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 6)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(6, N'BEN');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 7)
BEGIN
	
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(7, N'BIQ');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 8)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(8, N'CABAL');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 9)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(9, N'COOPERCARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 10)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(10, N'DINERSCLUB');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 11)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(11, N'DISCOVER');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 12)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(12, N'ELO');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 13)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(13, N'FORTBRASIL');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 14)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(14, N'GREENCARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 15)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(15, N'HIPERCARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 16)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(16, N'JCB');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 17)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(17, N'MASTERCARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 18)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(18, N'NUTRICARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 19)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(19, N'SENFF'); 
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 20)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(20, N'SODEXO');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 21)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(21, N'SOROCRED');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 22)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(22, N'TICKET');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 23)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(23, N'UNIONPAY');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 24)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(24, N'UPBRASIL');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 25)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(25, N'VALECARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 26)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(26, N'VERDECARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 27)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(27, N'VEROCARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 28)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(28, N'VISA');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 29)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(29, N'VR');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 30)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(30, N'GOODCARD');
END

IF NOT EXISTS (SELECT 1 FROM POS_CONNECT_BANDEIRA WHERE CD_BANDEIRA = 31)
BEGIN
	INSERT INTO POS_CONNECT_BANDEIRA (CD_BANDEIRA, NOME) VALUES(31, N'BONUSCRED');
END



END


