Port of Oulu

pgVES_ARR: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) [SELECT VIS_VES.ID AS VESID,VIS_VES.VES_REG_ID,VIS_VES.VES,VIS_VES.FPORT,VIS_VES.TPORT,VIS_AGT.ID AS AGTID,VIS_AGT.ETA,VIS_AGT.ETS,VIS_AGT.ATA,VIS_AGT.ATS,VIS_AGT.UPDATER,VIS_AGT.UPDATED,VIS_AGT.CUS_REG_ID_A,VIS_AGT.CUS_REG_ID_D,CUS_REG1.clName AS AGE1,CUS_REG2.clName AS AGE2,VIS_AGT.carPreImp,VIS_AGT.carPreExp,VIS_AGT.TERM_REG_ID,VIS_AGT.BERTH_REG_ID,TERM_REG.CAPTION AS TERM,BERTH_REG.CAPTION AS BERTH,B1.CAPTION AS MISTA,A1.BERTH_REG_ID AS MISTA_ID,B2.CAPTION AS MIHIN,A2.BERTH_REG_ID AS MIHIN_ID,VES_REG.NAT FROM VIS_VES LEFT OUTER JOIN VIS_AGT ON VIS_VES.ID = VIS_AGT.VIS_VES_ID LEFT OUTER JOIN TERM_REG ON VIS_AGT.TERM_REG_ID = TERM_REG.ID LEFT OUTER JOIN VES_REG ON VIS_VES.VES_REG_ID = VES_REG.ID LEFT OUTER JOIN BERTH_REG ON VIS_AGT.BERTH_REG_ID = BERTH_REG.ID LEFT OUTER JOIN CUS_REG CUS_REG1 ON CUS_REG1.ID = VIS_AGT.CUS_REG_ID_A LEFT OUTER JOIN CUS_REG CUS_REG2 ON CUS_REG2.ID = VIS_AGT.CUS_REG_ID_D LEFT OUTER JOIN VIS_AGT AS A1 ON A1.ETA = (SELECT MAX(ETA) FROM VIS_AGT AS C1 WHERE C1.ETA < VIS_AGT.ETA AND C1.VIS_VES_ID = VIS_AGT.VIS_VES_ID) AND A1.VIS_VES_ID=VIS_AGT.VIS_VES_ID LEFT OUTER JOIN BERTH_REG AS B1 ON B1.ID = A1.BERTH_REG_ID LEFT OUTER JOIN VIS_AGT AS A2 ON A2.ETA = (SELECT MIN(ETA) FROM VIS_AGT AS C2 WHERE C2.ETA > VIS_AGT.ETA AND C2.VIS_VES_ID = VIS_AGT.VIS_VES_ID) AND A2.VIS_VES_ID=VIS_AGT.VIS_VES_ID LEFT OUTER JOIN BERTH_REG AS B2 ON B2.ID = A2.BERTH_REG_ID WHERE VIS_AGT.ATA IS NULL AND VIS_AGT.ETA<'20.04.2024' ORDER BY VIS_AGT.ETA ASC; ]