请高手看看?为何{"第 15 行: ',' 附近有语法错误。\r\n在关键字 'AS' 附近有语法错误。\r\n在关键字 'AS' 附近有语法错误。" }
IF charindex( '_ ',@FeederDep)> 0 AND charindex( '_ ',@Destination)> 0
BEGIN
EXEC (
'INSERT ' + @Airline + ' (
Departure,
Destination,
FeederRoutingID,
OnlineRoutingID,
InterlineRoutingID,
FeederFareID,
OnlineFareID,
InterlineFareID,
ContractID,
DateFrom,
DateTo,
IsRoundTrip,
Airline)
SELECT t1.a as Departure,t2.a as Destination, '+
@FeederRoutingID + ', ' +
@OnlineRoutingID+ ', ' +
@InterlineRoutingID+ ', ' +
@FeederFareID+ ', ' +
@OnlineFareID+ ', ' +
@InterlineFareID+ ', ' +
@ContractID+ ', ' +
@DateFrom+ ', ' +
@DateTo+ ', ' +
@IsRoundTrip+ ', ' +
@Airline + '
FROM
(
select airportcode As a from
(select * from zone where zoneNo= ' ' ' + @FeederDep + ' ' ')Z
INNER JOIN ZoneElement ZE ON Z.zoneID=ZE.zoneID
INNER JOIN MST_AirPort A ON A.AirPortID=ZE.AirPortID
) AS t1
CROSS JOIN
( select airportcode As a from
(select * from zone where zoneNo= ' ' ' + @Destination + ' ' ')Z
INNER JOIN ZoneElement ZE ON Z.zoneID=ZE.zoneID
INNER JOIN MST_AirPort A ON A.AirPortID=ZE.AirPortID
) AS t2
ORDER BY Departure,Destination ')
END
-- 2,@FeederDep为airport,@Destination为zone
IF charindex( '_ ',@FeederDep)=0 AND charindex( '_ ',@Destination)> 0
BEGIN
EXEC(
'INSERT ' + @Airline + ' (
Departure,
Destination,
FeederRoutingID,
OnlineRoutingID,
InterlineRoutingID,
FeederFareID,
OnlineFareID,
InterlineFareID,
ContractID,
DateFrom,
DateTo,
IsRoundTrip,
Airline)
SELECT t1.a as Departure,t2.a as Destination, ' +
@FeederRoutingID+ ', ' +
@OnlineRoutingID+ ', ' +
@InterlineRoutingID+ ', ' +
@FeederFareID+ ', ' +
@OnlineFareID+ ', ' +
@InterlineFareID+ ', ' +
@ContractID+ ', ' +
@DateFrom+ ', ' +
@DateTo+ ', ' +
@IsRoundTrip+ ', ' +
@Airline + '
FROM
(
SELECT * FROM dbo.fn_split( '