Home INSERTING INTO table on Linked Server
Reply: 0

INSERTING INTO table on Linked Server

user1734
1#
user1734 Published in April 27, 2018, 6:51 am

I have this

IF @publishdr = 1 
BEGIN
TRUNCATE TABLE [LINKEDSERVERNAME].[Website-LIVE].[dbo].[VehicleData]
INSERT INTO [LINKEDSERVERNAME].[Website-LIVE].[dbo].[VehicleData]
(VehicleRef, Type, CapId, Maintenance, 
CH_2YR_SOURCE, CH_3YR_SOURCE, CH_4YR_SOURCE, PCH_2YR_SOURCE, PCH_3YR_SOURCE, PCH_4YR_SOURCE,
Manufacturer, Model, ShortModText, Derivative, ShortDerText, ManufacturerUrl, ModelUrl, ShortModTextUrl, DerivativeUrl, ShortDerTextUrl, VehicleUrl,
Category, LoCatCode, Fuel, Transmission, Doors, DriveTrain, Seats, Mpg, BodyType, BodyTypeId, 
CO2, EngineSize, InsuranceGroup, BHP, ManufacturerRRP,
VanCategory, VanMaxPayload, VanMaxLoadLength, VanMaxLoadWidthBetweenArches, VanMaxLoadWidth, VanMaxLoadHeight,
Co2TaxMonthly, Co2Tax40Monthly, IsInStock, AdhocVehicleRef,
InfoJson)
SELECT VehicleRef, Type, CapId, Maintenance, 
CH_2YR_SOURCE, CH_3YR_SOURCE, CH_4YR_SOURCE, PCH_2YR_SOURCE, PCH_3YR_SOURCE, PCH_4YR_SOURCE,
Manufacturer, Model, ShortModText, Derivative, ShortDerText, ManufacturerUrl, ModelUrl, ShortModTextUrl, DerivativeUrl, ShortDerTextUrl, VehicleUrl,
Category, LoCatCode, Fuel, Transmission, Doors, DriveTrain, Seats, Mpg, BodyType, BodyTypeId, 
CO2, EngineSize, InsuranceGroup, BHP, ManufacturerRRP,
VanCategory, VanMaxPayload, VanMaxLoadLength, VanMaxLoadWidthBetweenArches, VanMaxLoadWidth, VanMaxLoadHeight,
Co2TaxMonthly, Co2Tax40Monthly, IsInStock, AdhocVehicleRef,
InfoJson
FROM #VehicleData
END

I get this error:

The object name 'LINKEDSERVERNAME.Website-LIVE.dbo.VehicleData' contains more than the maximum number of prefixes. The maximum is 2.

I thought that was the correct syntax to specify tables on a linked server.

Thanks

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.315545 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO