CREATE OR ALTER VIEW LD0VAA0SurveyAdditionalData AS
SELECT
	U27.KORKORT,
	U27.KORKORTA,
	U27.KORKORTB,
	U27.KORKORTC,
	U27.KORKORTD,
	U27.KORKORTE,
	U27.OVRFORD1,
	U27.OVRFORD2,
	U27.OVRFORD3,
	U27.UPDDAT,
	U27.UPDSIGN,
	U27.KORKORTA1,
	U27.KORKORTBE,
	U27.KORKORTCE,
	U27.KORKORTDE,
	U27.UTLANDSKT,
	U27.GILTIGTTOM,
	U27.KORKORTAM,
	U27.KORKORTA2,
	U27.KORKORTB96,
	U27.KORKORTC1,
	U27.KORKORTC1E,
	U27.KORKORTD1,
	U27.KORKORTD1E,
	U27.KARTLAGGNR,
	U27.AUTOMATIC,
	U27.YKBGILTIGTFROM,
	U27.YKBGILTIGTTOM,
	Q1.KLARTEXT AS OVRFORD1_T,
	Q2.KLARTEXT AS OVRFORD2_T,
	Q3.KLARTEXT AS OVRFORD3_T,
	Q4.KLARTEXT AS ERSATTNTYP_T
FROM LD0P0U27 U27
LEFT OUTER JOIN LD0V0Q01 AS Q1
	ON Q1.KODTYP = 'LNFORDON'
	AND Q1.KOD = U27.OVRFORD1
LEFT OUTER JOIN LD0V0Q01 AS Q2
	ON Q2.KODTYP = 'LNFORDON'
	AND Q2.KOD = U27.OVRFORD2
LEFT OUTER JOIN LD0V0Q01 AS Q3
	ON Q3.KODTYP = 'LNFORDON'
	AND Q3.KOD = U27.OVRFORD3
LEFT OUTER JOIN LD0V0Q01 AS Q4
	ON Q4.KODTYP = 'LNERSTYP'
	AND Q4.KOD = U27.ERSATTNTYP;
GO

GRANT ALL ON LD0VAA0SurveyAdditionalData TO LD0ROANV
GO
