Guys,Kindly please help me to identify this error appears when im running this script. i will show you some parts of the scripts.Error:Msg 102, Level 15, State 1, Line 10Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 24Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 27Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 31Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 46Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 75Incorrect syntax near 'ivt'.Msg 102, Level 15, State 1, Line 90Incorrect syntax near ' '.Scripts:SELECT consupmtionTable.Asuprodlined ,consupmtionTable.itemid ,consupmtionTable.partNo ,finishedfone = coalesce(finphones.finishedfone,0) ,it.itemname ,coalesce( ( CASE WHEN EXISTS (select itemgroupid from dbo.inventitemgroup where dataareaid='tmp' and itemgroupid = it.itemgroupid and asuCore = 1) THEN 1 ELSE CAST(bomTable.requiredQty AS NUMERIC ) END * finphones.finishedfone),0 ) AS REQUIREDQTY ,SUM(consupmtionTable.NEWCOST) AS NEWPARTAVGCOST ,SUM(consupmtionTable.REFURBCOST) AS REFURBPARTAVGCOST ,CAST(SUM(consupmtionTable.NEWQTY) AS NUMERIC) AS NEWPARTSQTY ,CAST(SUM(consupmtionTable.RECLAIMQTY) AS NUMERIC) AS RECLAIMQTY ,CAST(SUM(consupmtionTable.REFURBQTY) AS NUMERIC) AS REFURBQTY ,CAST(SUM(consupmtionTable.NEWQTY) + SUM(consupmtionTable.RECLAIMQTY)+ SUM(consupmtionTable.REFURBQTY) AS NUMERIC) AS TOTAL FROM ( select x.requiredPart,x.itemid,sum(x.requiredQty) as requiredQty from ( select prodlist.itemid,bomlist.partQty as requiredQty, bomlist.partId as requiredPart from ( select distinct pt.Itemid from #Prod pt group by pt.Itemid ) prodList left outer join ( select bv.itemid as phoneId, bom.bomqty as partQty, bom.itemid as partId from dbo.bomversion bv inner join dbo.bom on bom.dataareaid = bv.dataareaid and bom.bomid = bv.bomid where bv.dataareaid='tmp' and bom.dataareaid='tmp' AND bv.name = 'Normal' and bom.bomqty > 0 )bomList on bomList.phoneId = prodList.itemid )x group by x.itemid,x.requiredPart ) bomTable
what are the cause of these error.Thank you in advncejov