H
Hansjörg Zimmermann
Hi,
i have a stored procedure which transfers records from one table to another.
The first table has about 14000 records.
When i run the procedure only 10000 records are tranfered. I have specified
to transfer 'TOP 100 PERCENT'.
Any ideas, what the reason could be ?
Here is the procedure:
----------------------
INSERT INTO dbo.tFlightMovement
(FlightTypeId, AircraftId, DepAirport,
DepServiceAgent, DesAirport, DesServiceAgent, BlockOff, BlockOn, TakeOff,
LandingTime, NightTime, CustomerId,
NoOfPassengers, FuelUnitUplift, FuelUplift,
FuelUnitTank, FuelSupplier, FuelOff, FuelOn, FreightUnit, Remarks)
SELECT TOP 100 PERCENT dbo.tcdFlightType.FlightTypeId,
dbo.tAircraft.AircraftId, dbo.tAirport.ApId, dbo.vmigServiceAgent.PartnerId,
tAirport_1.ApId AS Expr1,
vmigServiceAgent_1.PartnerId AS Expr2,
dbo.tmigMOYYMM.BlockOffTime2, dbo.tmigMOYYMM.BlockOnTime2,
dbo.tmigMOYYMM.TakeOffTime2,
dbo.tmigMOYYMM.LandingTime2, dbo.tmigMOYYMM.NightTime,
dbo.vmigCustomer.PartnerId AS Expr3, dbo.tmigMOYYMM.NoOfPassengers,
dbo.tcdLiquidUnit.LiquidUnitId,
dbo.tmigMOYYMM.FuelUplift, dbo.tAircrafttype.LiquidUnitId AS Expr4,
dbo.vmigPostingSupplier.PartnerId AS Expr5,
dbo.tmigMOYYMM.FuelOff, dbo.tmigMOYYMM.FuelOn,
dbo.tcdWeightUnit.WeightUnitId, dbo.tmigMOYYMM.Remarks
FROM dbo.tcdFlightType RIGHT OUTER JOIN
dbo.tcdLiquidUnit RIGHT OUTER JOIN
dbo.tcdWeightUnit RIGHT OUTER JOIN
dbo.tAircrafttype RIGHT OUTER JOIN
dbo.tmigMOYYMM INNER JOIN
dbo.tAircraft ON dbo.tmigMOYYMM.AcCallsignFIS =
dbo.tAircraft.AcCallsignFIS LEFT OUTER JOIN
dbo.vmigPostingSupplier ON dbo.tmigMOYYMM.FuelSupplier
= dbo.vmigPostingSupplier.AlphakeyFIS ON
dbo.tAircrafttype.AcTypeId = dbo.tAircraft.AcTypeId ON
dbo.tcdWeightUnit.WeightUnitCd = dbo.tmigMOYYMM.FreightUnit ON
dbo.tcdLiquidUnit.LiquidUnitCd =
dbo.tmigMOYYMM.FuelUnitUplift LEFT OUTER JOIN
dbo.vmigCustomer ON dbo.tmigMOYYMM.Customer =
dbo.vmigCustomer.AlphakeyFIS ON
dbo.tcdFlightType.FlightTypeCd =
dbo.tmigMOYYMM.FlightType LEFT OUTER JOIN
dbo.tAirport tAirport_1 ON dbo.tmigMOYYMM.DesICAOcd =
tAirport_1.ICAOcd LEFT OUTER JOIN
dbo.vmigServiceAgent vmigServiceAgent_1 ON
dbo.tmigMOYYMM.DesHandling = vmigServiceAgent_1.AlphakeyFIS LEFT OUTER JOIN
dbo.tAirport ON dbo.tmigMOYYMM.DepICAOcd =
dbo.tAirport.ICAOcd LEFT OUTER JOIN
dbo.vmigServiceAgent ON dbo.tmigMOYYMM.DepHandling =
dbo.vmigServiceAgent.AlphakeyFIS
i have a stored procedure which transfers records from one table to another.
The first table has about 14000 records.
When i run the procedure only 10000 records are tranfered. I have specified
to transfer 'TOP 100 PERCENT'.
Any ideas, what the reason could be ?
Here is the procedure:
----------------------
INSERT INTO dbo.tFlightMovement
(FlightTypeId, AircraftId, DepAirport,
DepServiceAgent, DesAirport, DesServiceAgent, BlockOff, BlockOn, TakeOff,
LandingTime, NightTime, CustomerId,
NoOfPassengers, FuelUnitUplift, FuelUplift,
FuelUnitTank, FuelSupplier, FuelOff, FuelOn, FreightUnit, Remarks)
SELECT TOP 100 PERCENT dbo.tcdFlightType.FlightTypeId,
dbo.tAircraft.AircraftId, dbo.tAirport.ApId, dbo.vmigServiceAgent.PartnerId,
tAirport_1.ApId AS Expr1,
vmigServiceAgent_1.PartnerId AS Expr2,
dbo.tmigMOYYMM.BlockOffTime2, dbo.tmigMOYYMM.BlockOnTime2,
dbo.tmigMOYYMM.TakeOffTime2,
dbo.tmigMOYYMM.LandingTime2, dbo.tmigMOYYMM.NightTime,
dbo.vmigCustomer.PartnerId AS Expr3, dbo.tmigMOYYMM.NoOfPassengers,
dbo.tcdLiquidUnit.LiquidUnitId,
dbo.tmigMOYYMM.FuelUplift, dbo.tAircrafttype.LiquidUnitId AS Expr4,
dbo.vmigPostingSupplier.PartnerId AS Expr5,
dbo.tmigMOYYMM.FuelOff, dbo.tmigMOYYMM.FuelOn,
dbo.tcdWeightUnit.WeightUnitId, dbo.tmigMOYYMM.Remarks
FROM dbo.tcdFlightType RIGHT OUTER JOIN
dbo.tcdLiquidUnit RIGHT OUTER JOIN
dbo.tcdWeightUnit RIGHT OUTER JOIN
dbo.tAircrafttype RIGHT OUTER JOIN
dbo.tmigMOYYMM INNER JOIN
dbo.tAircraft ON dbo.tmigMOYYMM.AcCallsignFIS =
dbo.tAircraft.AcCallsignFIS LEFT OUTER JOIN
dbo.vmigPostingSupplier ON dbo.tmigMOYYMM.FuelSupplier
= dbo.vmigPostingSupplier.AlphakeyFIS ON
dbo.tAircrafttype.AcTypeId = dbo.tAircraft.AcTypeId ON
dbo.tcdWeightUnit.WeightUnitCd = dbo.tmigMOYYMM.FreightUnit ON
dbo.tcdLiquidUnit.LiquidUnitCd =
dbo.tmigMOYYMM.FuelUnitUplift LEFT OUTER JOIN
dbo.vmigCustomer ON dbo.tmigMOYYMM.Customer =
dbo.vmigCustomer.AlphakeyFIS ON
dbo.tcdFlightType.FlightTypeCd =
dbo.tmigMOYYMM.FlightType LEFT OUTER JOIN
dbo.tAirport tAirport_1 ON dbo.tmigMOYYMM.DesICAOcd =
tAirport_1.ICAOcd LEFT OUTER JOIN
dbo.vmigServiceAgent vmigServiceAgent_1 ON
dbo.tmigMOYYMM.DesHandling = vmigServiceAgent_1.AlphakeyFIS LEFT OUTER JOIN
dbo.tAirport ON dbo.tmigMOYYMM.DepICAOcd =
dbo.tAirport.ICAOcd LEFT OUTER JOIN
dbo.vmigServiceAgent ON dbo.tmigMOYYMM.DepHandling =
dbo.vmigServiceAgent.AlphakeyFIS