mostre a correção para as linhas com erro de sintaxe:

select tmp.* into ##tempDuplaValdcAuxHist from (
				case @cTpoSoltc 
					when 0 -- Tipo de Solicitação 0: Hierarquia
						THEN 
							SELECT 
								(select coalesce(IDENT_INCR('tDuplaValdc'), @indice)) as cSoltcAltAux
								,0 as cHistFutur -- 0 = histórico
								,cCartProdt
								,rCartProdt
								,tpo
								,cParmzHierqProdt
								,cHierqEmprProdt
								,rHierqEmprProdt
								,cHierqFamlProdt
								,rHierqFamlProdt
								,cHierqGrpProdt
								,rHierqGrpProdt
								,cHierqSgrpProdt
								,rHierqSgrpProdt
								,NULL AS cModldOperCredt
								,NULL AS rModldOperCredt
								,NULL AS cSmdldOperCredt
								,NULL AS rSmdldOperCredt
								,cIndcdSitReg
								,rHierqProdtSit
								,nParmConslCli
								,rParmConslCli
							FROM fn_GetProdtByHierq(@cObjetAlt)) as tmp

					when 1 -- Tipo de Solicitação 1: Produto
						THEN
							SELECT 
							(select coalesce((SELECT @indice + 1), @indice)) as cSoltcAltAux
							,0 as cHistFutur -- 0 = histórico
							,cCartProdt
							,rCartProdt
							,tpo
							,cParmzHierqProdt
							,cHierqEmprProdt
							,rHierqEmprProdt
							,cHierqFamlProdt
							,rHierqFamlProdt
							,cHierqGrpProdt
							,rHierqGrpProdt
							,cHierqSgrpProdt
							,rHierqSgrpProdt
							,NULL AS cModldOperCredt
							,NULL AS rModldOperCredt
							,NULL AS cSmdldOperCredt
							,NULL AS rSmdldOperCredt
							,cIndcdSitReg
							,rHierqProdtSit
							,nParmConslCli
							,rParmConsl