IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V1APPEAL')
BEGIN
DROP VIEW LD0V1APPEAL
END
GO
CREATE VIEW LD0V1APPEAL   
AS 
SELECT APP.*, E.DATUM AS DECISIONDATE
FROM LD0P0APPEAL APP
LEFT JOIN LD0V0E E
ON APP.BESLUTNR = E.BESLUTNR
GO
GRANT ALL ON LD0V1APPEAL TO LD0ROANV
GO
