【发布时间】:2016-05-27 21:58:44
【问题描述】:
我是 SQL Server 的完全初学者,我已经达到了我的极限。
目前我正在使用一个脚本来使用一个列从另一个表中更新一个表。由于这两个数据库都分配给了 2 个不同的 3rd 方软件,我创建了一个 .bat 脚本用于 windows 服务器中的任务管理器,这样它可以每 10 分钟更新一次。
虽然这已经过测试并且有效,但我觉得必须有一种方法可以在两个数据库之间创建关系,而无需使用该任务。
UPDATE therefore.dbo.thecat51
SET num_factura =
(SELECT therefore.dbo.documentos.num_factura
FROM therefore.dbo.Documentos
WHERE therefore.dbo.thecat51.num_albaran=therefore.dbo.documentos.num_albaran)
WHERE therefore.dbo.thecat51.num_albaran =
( SELECT therefore.dbo.documentos.num_albaran
FROM therefore.dbo.Documentos
WHERE therefore.dbo.thecat51.num_Albaran = therefore.dbo.documentos.num_albaran)
另外,我们使用的是 SQL Server Express,所以我没有创建计划作业的选项。
【问题讨论】:
-
链接服务器可能就是您正在查看的内容 -> google.fr/…