Quantcast
Channel: AYUDA CON IF EN SQL
Viewing all articles
Browse latest Browse all 7

AYUDA CON IF EN SQL

$
0
0

saludos he agregado este segmento de codigo a un procedure grande

if @KeepDrayCost=1  
    begin        
    exec sp_PWB_RouteGenerateCalcDrayRates @piRFQNumber, @piRFQVersionID   
    end
    else 
    if @KeepDrayCost=0
    begin
       IF #tmpRFQRoutingStep.RoutingType='Origin Dray'
      update   #tmpRFQRoutingStep 
           SET 
               tmpRFQRS.DrayRate=RFQVL.OrigDrayRate,
               tmpRFQRS.DrayCost=RFQVL.OrigDrayCost,
               tmpRFQRS.caf=RFQVL.OrigCAF,
               tmpRFQRS.DrayPCPercent=RFQVL.OrigPCPercent,
               tmpRFQRS.Rate=RFQVL.OrigRate
               from #tmpRFQRoutingStep tmpRFQRS
               INNER JOIN RFQVersionLane  RFQvl
               on tmpRFQRS.RFQVersionLaneId=RFQVersionLane.RFQVersionLaneId              
      ELSE IF #tmpRFQRoutingStep.RoutingType='Destination Dray' 
       update  #tmpRFQRoutingStep 
            SET   
           tmpRFQRS.DrayRate=RFQVL.DestDrayRate,
           tmpRFQRS.DrayCost=RFQVL.DestDrayCost,
           tmpRFQRS.caf=RFQVL.DestCAF,
	       tmpRFQRS.DrayPCPercent=RFQVL.DestPCPercent,
	       tmpRFQRS.Rate=RFQVL.DestRate
	          from #tmpRFQRoutingStep tmpRFQRS
               INNER JOIN RFQVersionLane  RFQvl
               on tmpRFQRS.RFQVersionLaneId=RFQVersionLane.RFQVersionLaneId 
	     end

y me sale este error

Msg 4104, Level 16, State 1, Procedure sp_PWB_LoadRFQVersionLaneLowestCostRouteAll_1, Line 802

The multi-part identifier "#tmpRFQRoutingStep.RoutingType" could not be bound.

Msg 4104, Level 16, State 1, Procedure sp_PWB_LoadRFQVersionLaneLowestCostRouteAll_1, Line 814

The multi-part identifier "#tmpRFQRoutingStep.RoutingType" could not be bound.

Y NO SE SI ES MI CODIGO O ES OTRA CVOSA QUIZAS LOS IF


Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images