Hi ..
I have tried calling sp_linkedservers(for reading) from OPENQUERY function(for updating),the process was slow and resource intensive on our side.
The ff. is what I have done:-
I created the sp_linkedsevers and opened the database ports and also permission.
Step 1. I created the sp_linkedservers and and wrote away to another file.
Step 2. I then wrote an update which updates the aliased sql DB table.
below is my sql example :-
Every nested query in the FROM clause must have an alias:
SELECT Company, Branch,
Name,oc_ManagerID,oc_ManagerName,SalesBudget1,SalesBudget2, SalesBudget3
from(
SELECT 'Company1' AS Company, Branch,
Name,oc_ManagerID,oc_ManagerName,SalesBudget1,SalesBudget2, SalesBudget3
FROM ProCoyA.dbo.SalSalesperson
UNION
SELECT 'Company2' AS Company, Branch,
Name,oc_ManagerID,oc_ManagerName,SalesBudget1,SalesBudget2, SalesBudget3
FROM ProCoyB.dbo.SalSalesperson
UNION
SELECT 'Company3' AS Company, Branch,
Name,oc_ManagerID,oc_ManagerName,SalesBudget1,SalesBudget2, SalesBudget3
FROM ProCoyP.dbo.SalSalesperson
) AS Merged
WHERE Company IN (:companies)
This works on our side.Tested on MSSQL2008 and MySql database.I hope this helps.
Matthews Estrice