IF EXISTS (SELECT 1 FROM SYS.COLUMNS WHERE NAME = 'CD_CHAVE' AND OBJECT_ID = OBJECT_ID('PRC_FILIAL_CONFIG'))
BEGIN
ALTER TABLE PRC_FILIAL_CONFIG DISABLE CHANGE_TRACKING;

ALTER TABLE PRC_FILIAL_CONFIG	DROP CONSTRAINT PK_PRC_FILIAL_CONFIG;

ALTER TABLE PRC_FILIAL_CONFIG ALTER COLUMN CD_CHAVE	NVARCHAR (100) NOT NULL;

ALTER TABLE PRC_FILIAL_CONFIG ADD CONSTRAINT PK_PRC_FILIAL_CONFIG PRIMARY KEY (CD_EMP, CD_FILIAL, CD_CHAVE);

ALTER TABLE PRC_FILIAL_CONFIG	ENABLE CHANGE_TRACKING;

ALTER TABLE PRC_FILIAL_CONFIG_AUDIT_TRIGGER ALTER COLUMN CD_CHAVE	NVARCHAR (100) NOT NULL;
END

