Remote Stored Procedure kan kaldes som fire dele navn:
EXEC [RemoteServer] .DatabaseName.DatabaseOwner.StoredProcedureName
Jeg er ikke sikker på, hvorfor du bruger dynamisk SQL. Prøv sådan her.
meget , BookingNo, BookingDate, NoofPassengers, Noofluggages, NoofHandluggages, PickupDatetime, ReturnPickUpDatetime, IsCompanywise, CompanyId, Farerate, PaymentTypeid, SpecialRequirements, fromAddress, Toaddress, FromPostCode, Topostcode, fradoorno, TOOROREORNO, FROMSTRESTE ,AutoDespatchTime ,AddOn ,AddBy ,AddLog ,EditOn ,EditBy ,EditLog ,OrderNo ,PupilNo ,ParkingCharges ,WaitingCharges ,ExtraDropCharges ,MeetAndGreetCharges ,CongtionToDarges ,DepartmentCharges RrivalDatetime, MasterJobid, DeaktiverPassagermersmer, handicappede rammer, iscommissionwise, førerkomission, forsendelse Datetime, JobofferDatetime, bookingTypeid, drivercommissionType, isbidding, isquotation, omkostningscentre, kontant, accounttrate, ventetiner, ekstridile, accepterethedtimeTimeTimeTimeTimeTime, stødning, PartyId ,FromOther ,ToOther ,TransferJobId ,TransferJobCommission ,BookingTypeId ,ViaString )SELECT FromLocTypeId ,ToLocTypeId ,FromLocId ,ToLocId ,VehicleTypeId ,NULL ,ReturnDriverId ,CustomerId ,CustomerName ,CustomerEmail ,CustomerPhoneNo ,CustomerMobileNo ,JourneyTypeId ,BookingNo ,BookingDate ,NoofPassengers ,NoofLuggages ,NoofHandLuggages ,PickupDateTime ,ReturnPickupDateTime ,IsCompanyWise ,NULL ,FareRate ,Payment TypeId ,SpecialRequire Menter, fromAddress, Toaddress, FrompostCode, Topostcode, Fromdoorno, ToDOORNO, Fromstreet, ToStreet, FromFlightNo, FromComing, BookingStatusID, Distancestring, AutoDespatch, AutodespatchTime, Addon, Laidby, Laitingch Extradroplades, meetandgreetcharges, congtioncharges, totalcharges, departmentid, returnerate, ankomst, STCDateTime ,ClearedDateTime ,CancelReason ,TotalTravelledMiles ,CompanyPrice ,1 ,@PartyId ,FromOther ,ToOther ,@JOB_id ,@Commission , 10 ,ViaStringFROM BookingWHERE Id =@JOB_id;SELECT SCOPE_IDENTITY()