IF NOT EXISTS(SELECT 1 FROM sys.columns 
          WHERE Name = N'EJINTEGRATION'
          AND Object_ID = Object_ID(N'LD0P0G04'))
BEGIN
ALTER TABLE LD0P0G04 ADD 
	EJINTEGRATION  DECIMAL(1)
	CONSTRAINT LD0D0G04_EJINTEGRATION DEFAULT 0 NOT NULL
END
GO

IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V0G04')
  BEGIN
    DROP VIEW LD0V0G04
  END
GO

CREATE VIEW LD0V0G04
AS 
SELECT * FROM LD0P0G04 
GO

GRANT ALL ON LD0V0G04 TO LD0ROANV
GO
