开发者

Mapping to different linked servers per database

开发者 https://www.devze.com 2023-03-04 23:15 出处:网络
I have an MSSQL Server 2008 database \"DBLive\" that link to three different external servers [ExtServer1, ExtServer2, ExtServer3], all defined in sys.servers.There are several stored procedures that

I have an MSSQL Server 2008 database "DBLive" that link to three different external servers [ExtServer1, ExtServer2, ExtServer3], all defined in sys.servers. There are several stored procedures that refer to stored procs or tables on the external servers, f.x. like 'SELECT TOP 1 @SomeId = Id FROM [ExtServer1].TheExtDB.dbo.SomeTable WHERE ...'.

开发者_StackOverflow社区

Here is the challenge - if I want to put an database on the server - "DBTest" which is an identical copy of "DBLive" - but which should connect to different external servers - how do I make [ExtServer1 .. 3] point to a different external servers for "DBLive" and "DBTest"?

If this cannot be done - what would be the preferred way of linking external databases in such a way that two instances of the same db, can have their own external server references - without having differences in the stored procedures?


You'd probably want to use synonyms here. See the work around suggested in this Microsoft Connect issue (and vote up the issue while you're there).

0

精彩评论

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

关注公众号