开发者

SQL Server Linked Server

All,

I am trying out a new linked server - I can run this command fine:

SELECT * FROM NextGen4.NGEPMWareHouse.dbo.Network_People

If I try to get fancy (update a table on my local server from the linked server)

UPDATE dbo.Network_People
SET dbo.Network_People.NGTimeStamp = NextGen4.NGEPMWareHouse.dbo.Network_People.[TimeStamp]
WHERE dbo.Network_People.HIN = NextGen4.NGEPMWareHouse.dbo.Network_People.HIN

I get

The num开发者_JAVA技巧ber name 'NextGen4.NGEPMWareHouse.dbo.Network_People' contains more than the maximum number of prefixes. The maximum is 3.


Try woking with UPDATE … FROM and an alias.

UPDATE 
  dbo.Network_People
SET 
  NGTimeStamp = warehouse.[TimeStamp]
FROM
  NextGen4.NGEPMWareHouse.dbo.Network_People AS warehouse
  INNER JOIN dbo.Network_People AS people ON people.HIN = warehouse.HIN


Try to exclude ".dbo" prefix from your tablenames and use "update from"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜