IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V1NEXTPROCESSMAPPING')
BEGIN
DROP VIEW LD0V1NEXTPROCESSMAPPING
END
;
CREATE VIEW LD0V1NEXTPROCESSMAPPING AS   
SELECT M.ID , M.PROCESSID,  
P2.NAME [PROCESSNAME],  
M.NEXTPROCESSID,   
M.SHOWLINKEDPROCESS,  
P.NAME [NEXTPROCESSNAME],  
P.PROCESSOWNERTYPE [NEXTPROCESSOWNERTYPE]  
FROM LD0V0NEXTPROCESSMAPPING M  
INNER JOIN LD0V0PROCESS P ON P.ID=M.NEXTPROCESSID  
INNER JOIN LD0V0PROCESS P2 ON P2.ID=M.PROCESSID
;