IF NOT EXISTS (SELECT 1 FROM SYS.COLUMNS WHERE NAME = 'CD_FILIAL' AND OBJECT_ID = OBJECT_ID('EST_PROD_FARMACIA_POPULAR'))
BEGIN
     
ALTER TABLE EST_PROD_FARMACIA_POPULAR ADD CD_FILIAL INT NOT NULL DEFAULT 1;
    
ALTER TABLE EST_PROD_FARMACIA_POPULAR  DISABLE CHANGE_TRACKING ;
 ALTER TABLE EST_PROD_FARMACIA_POPULAR DROP CONSTRAINT PK_EST_PROD_FARMACIA_POPULAR 
 ALTER TABLE EST_PROD_FARMACIA_POPULAR ADD CONSTRAINT  PK_EST_PROD_FARMACIA_POPULAR PRIMARY KEY  (CD_EMP,CD_FILIAL,CD_PROD)
END
 