IF exists(SELECT * FROM sysobjects WHERE name = 'LD0V0FatherhoodIncomingErrand')
                        DROP VIEW LD0V0FatherhoodIncomingErrand
;

CREATE VIEW LD0V0FatherhoodIncomingErrand
AS
SELECT
E50.*, Q01.KLARTEXT MODERCIVILSTANDKOD_T
FROM LD0P0E50 E50 
LEFT JOIN LD0V0Q01 Q01 
ON E50.MODERCIVILSTANDKOD <> '' AND E50.MODERCIVILSTANDKOD = Q01.EXTKOD AND Q01.KODTYP = 'CIVS'
;