I'm in the process of moving off MySQL to a MS SQL environment and I'm re-writing all the SPs.
This error has me stumped.
[Microsoft][ODBC Driver 17 for SQL Server]Unspecified error occurred on SQL Server. Connection may have been terminated by the server.Cannot continue the execution because the session is in the kill state.
SQLSTATE: 08S01, code: 233
- Shared Memory Provider: No process is on the other end of the pipe. SQLSTATE: 08S01, code: 233
- Communication link failure
SQL: sp_MyDBR_Stat_AddEnd 629
The query I'm trying to run is
select iif(a.FPONo = '',0,iif (a.InvNumber not in (select CreditNumber from [PH-HV-BISSQL].[Company001].dbo.cnheader),
iif (f.LHours is null, iif(a.ItemCode not in (select par_code from [pharma].dbo.tbllabour_overview where tot_hours > 0),
(isnull((a.QTYInvoiced*d.tot_hours/d.tot_output),0))), (f.LHours*a.QTYInvoiced/c.fQty)),0)) as "Hours[LHrs]"
from #order_tmp a
left outer join #fpo_qty c on a.FPONo = c.fFPONo
left outer join [pharma].dbo.tbllabour_overview d on a.ItemCode = d.par_code
left outer join [pharma].dbo.tbllabour_prod e on a.ItemCode = e.par_code
left outer join [pharma].dbo.vw_lab_fpono f on a.FPONo = f.LFPO;
This runs ok in the MySql version of the system
Any help would most appreciated.