IF NOT EXISTS ( SELECT* FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE  WHERE CONSTRAINT_NAME = 'PK_RC_CLI_FIDELI_CARTAO' AND COLUMN_NAME = 'NR_CARTAO')
BEGIN 
	ALTER TABLE RC_CLI_FIDELI_CARTAO DISABLE CHANGE_TRACKING;
	ALTER TABLE RC_CLI_FIDELI_CARTAO DROP CONSTRAINT PK_RC_CLI_FIDELI_CARTAO;
	
END 

go 

IF NOT EXISTS ( SELECT * FROM SYS.KEY_CONSTRAINTS  WHERE NAME = 'PK_RC_CLI_FIDELI_CARTAO' )
BEGIN 
	ALTER TABLE RC_CLI_FIDELI_CARTAO ADD  CONSTRAINT PK_RC_CLI_FIDELI_CARTAO PRIMARY KEY (CD_EMP,CD_CLI,NR_CARTAO,CD_CTR_GLB_TP_FIDEL_LINXPROMO);
	ALTER TABLE RC_CLI_FIDELI_CARTAO ENABLE CHANGE_TRACKING; 
END 
