update uf_wenjian(表名)
set leibie=tm.leibie(赋值)
from (select * from opendatasource('sqloledb','data source=10.1.7.98;user id=sa;password=123456').[ecology].[dbo].[uf_wenjian]) tm(tm就是跨数据库表)
where uf_wenjian.id=tm.id(条件)
更高效率用法
Update T_OrderForm(表名)
SET SellerID =B.L_TUserID
FROM T_OrderForm A LEFT JOIN T_ProductInfo B (用left join加快表格查询)ON B.L_ID=A.ProductID